🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24338

Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules

#24338
From: Andrew Lunn
Date: Mon, 30 Nov 2026 03:01
25 lines
8955 bytes
> +	if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
> +		return -EOPNOTSUPP;
> +
>  	return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
>  			      VEND1_LED_REG(index),
>  			      VEND1_LED_REG_A_EVENT,

This works, but maybe:

	for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
		if (rules == as21xxx_led_supported_pattern[i].pattern) {
			val = as21xxx_led_supported_pattern[i].val;
			return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
			       		      VEND1_LED_REG(index),
					      VEND1_LED_REG_A_EVENT,
					      FIELD_PREP(VEND1_LED_REG_A_EVENT,
					                 val));

		}

	return -EOPNOTSUPP
}

	Andrew
Technical Details
Message-ID: <400a6e13-31fc-47ec-af3e-afccdf64655a@lunn.ch>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373799-linux-kernel-netdev=dewy.ru
References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com> <20261130-as21xxx-fixes-v1-10-1bd2eae6ccbc@collabora.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373799-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for
 unsupported rules
Date: Mon, 30 Nov 2026 04:01:28 +0100
Organization: Usenet Network
Message-ID: <400a6e13-31fc-47ec-af3e-afccdf64655a@lunn.ch>
References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com>
 <20261130-as21xxx-fixes-v1-10-1bd2eae6ccbc@collabora.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1317327"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:lnFO5s3vGKYwydca/2HCFXSUpvo= sha256:UURxuLPfLpIF1446KVKDqekWLQMcHZ/GRxLcvYzP7wA=
	sha1:+tAfIGPl5bNx9fv/AisjFRVSrnE= sha256:B4N3q8T8HZYLBwqz1ZGcTBlt3HpwfpcXBoiq3XdOV64=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 3E7A9125FB8; Mon, 30 Nov 2026 06:01:54 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id dTlEJ3Bs4hX6;
	Mon, 30 Nov 2026 06:01:51 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-373799-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 4669F125F08; Mon, 30 Nov 2026 06:01:41 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 4584F23564; Mon, 30 Nov 2026 03:01:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796007699;
	b=zjzfd8OqX5rfBhzj3jvTdrjEv9p/wQ9vga6e7o9gyHTKOaNOTm3pQyE5EIgWxD+/pgN8
	 1DufO4rZdTqpMSzw+g8JjCSF/lxaU6lmgVrG6v28wF1QfzdflelSi/CU9JS8GYtJ3vPq8
	 2JP8TkSxTg+/y9wILyt0gDb8kfGflGzQsetork4bj/kyvHL8fc/zR2hHGXmg9HObjOTpE
	 sYb7CrIsI0QtMDVZdzxTk2/8D4w+mSm20y7oKCt0UDSwBp3qa24xteuxC6uxuvgiwlgbQ
	 D8ykx7yszl6RKHB3ImObI3h9/Z2SLkOUDSG4Yn+DarCKGyQ91ETKHue2IXiY89NN06w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796007699;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=XpsgZk9UQ/nSFeNgwCzTcSDGzHiGBdndHBbPgWtwgFY=;
	b=Tb7405Y1Xiw3k7uQlEN/9owA7TCFvdO2Frs2NjcCV50vKWb+F8aSDrq6rCh6ymCXJgQa
	 Rz5Qt4R34PaJUqWgtcMO8OxS7dnis8HTVYMtrQ4SF34vILc5c43BfLGk8n0eRPEvM/n2V
	 IF8AHMiozdNpGI2J2Cg+nnsa4fpnlhIHK/KVWr/Q7gh927HTQ2zcn9d/lyAFdBN65gEUt
	 BVlk5Rcl/6GDX7Z/9eruz2IzKsRtj4gUdn9PQ2RBir1UMo+Jp6SpecnRhyhLBWTNU3boQ
	 Qkh2F+18FyG26CAgiEVxUMGKJGM8GHs7dDpq79itShQmvuIgV68oQWb5RCEMxHctDbQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=Zy2a70ew;
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D1160606A32E;
	Mon, 30 Nov 2026 03:01:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=Zy2a70ew
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796007699;
	b=fxgU/bEK6TiXyLkJMB5D6CPfYQI4Sklq6NpIhRPak6eVmpAqzpU0TErJkoEcNbAMsgNP
	 u6Ljo3yipsbeCsM8Jz58SCoubDrS/69kMRxyq0biuj9B1o226dWa+w/yJDfK1w/Z89zhd
	 +D7u2LSsUGx/TTmlX73I6CbIhumqzoG3sHVZ6CHO4DrXnXq9ObsgTAfOHAToQxRTg+X4y
	 lgokQ20uWhgwOmio5f9BGIDmTlGyeK46tilMsmhkS5jI3cdQNvugXnZUaU/SfovAsZ5y+
	 g6JqO5m9HKlzWwSsbko2DgMA+5a/TnNl+shP9OtXYJuEBdA5ZW/a2ao/YPh9BDefj3g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796007699;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To;
	bh=XpsgZk9UQ/nSFeNgwCzTcSDGzHiGBdndHBbPgWtwgFY=;
	b=Cl6d46rrmr0OAxSc5KeeMj/gyJF6PeQegBdMNNhVkd7Nhxyj6EWTxRqFV04D+enbmdZw
	 zrPbyJzITppAczTG900ty7qBu0R3TG53HGKQ9Nycjc/XgP/ZFEAy0hDOjjWe8X+pxnHDG
	 GRpB2JMufn8HvF5qX5w1yFRo296k1JSpGQCcwnZoJUrkxGdJdLTBVO0SNOC0Q2heUE16z
	 IwqBGt7Ajura9rkSJ7GKReSH2kKLJ7qLQbjlW2a0NGZ+8X0k0n8OmimTI91IVZchGhDdc
	 0Is+0mlpcqEHRqT/I5IrP2YsP5Hj6k1smfnA5zXc9OJnT16KjGdnQK7kMSkiffHkNKw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=Zy2a70ew;
	arc=none smtp.remote-ip=156.67.10.101
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADAFD606A325
	for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 03:01:38 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ADAFD606A325
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject:
	Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:
	Content-ID:Content-Description:Content-Disposition:In-Reply-To:References;
	bh=XpsgZk9UQ/nSFeNgwCzTcSDGzHiGBdndHBbPgWtwgFY=; b=Zy2a70ewMYnnEE4eqLBG5LvmkY
	YUA/Ch4iIKGvoAqZzy60HjPiaEkq7vrLaF3NZ+hbLgK2Im1GogJGw3ZNTUnz3r3KkaZHeHYbqhOoG
	Pieb9VgGeEXZeQurcwRrC2mAFv44B9TCqpeBrA5GD/sE/f0H/JZ6T89md3ncN+M24ljM=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xXrdw-002GdA-CK; Mon, 30 Nov 2026 04:01:28 +0100
X-Cc: Christian Marangi <ansuelsmth@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	kernel@collabora.com, netdev@vger.kernel.org
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261130-as21xxx-fixes-v1-10-1bd2eae6ccbc@collabora.com>