Article View: linux.kernel.netdev
Article #16018Re: [PATCH net-next 3/3] net: phy: dap8211r: add led hardware control support
From: Andrew Lunn
Date: Fri, 13 Nov 2026 20:32
Date: Fri, 13 Nov 2026 20:32
30 lines
9162 bytes
9162 bytes
> +#define DAP8211R_LED_ACT_BLINK BIT(13)
> +#define DAP8211R_LED_FULL_DUPLEX BIT(12)
> +#define DAP8211R_LED_HALF_DUPLEX BIT(11)
> +#define DAP8211R_LED_TX BIT(10)
> +#define DAP8211R_LED_RX BIT(9)
> +#define DAP8211R_LED_LINK_1000 BIT(6)
> +#define DAP8211R_LED_LINK_100 BIT(5)
> +#define DAP8211R_LED_LINK_10 BIT(4)
Do any of these bits allow forced on/off?
> +static int dap8211r_led_hw_is_supported(struct phy_device *phydev, u8 index, unsigned long rules)
> +{
> + switch (index) {
> + case DAP8211R_LED_ID_0:
> + fallthrough;
> + case DAP8211R_LED_ID_1:
> + fallthrough;
> + case DAP8211R_LED_ID_2:
> + break;
You can collapse case statements, without fallthrough, if there is no
code.
It is also possible to do:
case DAP8211R_LED_ID_0..DAP8211R_LED_ID_2:
Andrew
Technical Details
Message-ID:
<8ef5b0a7-58f6-4c62-8153-6a9c8d3703f7@lunn.ch>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362903-linux-kernel-netdev=dewy.ruReferences:
<20261113110546.173624-1-a.shimko.dev@gmail.com> <20261113110546.173624-4-a.shimko.dev@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362903-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 3/3] net: phy: dap8211r: add led hardware control support Date: Fri, 13 Nov 2026 21:32:55 +0100 Organization: Usenet Network Message-ID: <8ef5b0a7-58f6-4c62-8153-6a9c8d3703f7@lunn.ch> References: <20261113110546.173624-1-a.shimko.dev@gmail.com> <20261113110546.173624-4-a.shimko.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1450264"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:UFTcKA+oiWb5YFhZItipcSZtWgQ= sha256:x6dX6AQw3E5F7XZRMCJ889fKAhKbANdwjl5N1xjd8QY= sha1:H1MYkpT1rRhsicoRwq0CUJtiyYw= sha256:OV44ywtB+0A1W5xuplsny5AF7bGZY7zUInfKC80dSug= 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 317131146B2; Sat, 14 Nov 2026 01:05:13 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.95 X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, 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, URIBL_BLOCKED=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 c8E626dxghen; Sat, 14 Nov 2026 01:05:10 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-362903-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5876011460C; Sat, 14 Nov 2026 01:05:01 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 1665A28374C; Fri, 13 Nov 2026 20:33:08 +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=1794601984; b=WA1y1WWPoHknUodC4DCJahyoVVfgcZxoiaLfNN+f9vdqak0wSX4B2jtH9ecqVT5mnzqF jXc0WkGir2exd2dqYD9mwciaSzsP/C8U5ib00sVa0sYAsBMlkKTj0qCDo2DZ5itVV+hAB 88wunhz1VKlhdMvSsshs2mb9zWakkRtZSQQRzc3DUxeyhMGELaja4nF6LFyGg4VwH+N2y 3KwtNrtR+o+iD9/otniqoswXnn+qRxW0yTjrtAHtkvoS1GpR76qBGGcUPPIt1EHncJ+oI d/xnC4rshZwUhq6S57BiSQRzmxeIE5Keo3t1fMeqd7OLyzf4FH0HUa0+VnrqCfpeyrA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794601984; 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=KB3jO2Uh980sYfYogP8Ce6aR0qJaY2oratJHAC8zDpM=; b=R/p43focucIlCkEB07TYG5jcuEQWLRuSg2qOzHFL6Q22xOgOsrsELdZxpTcdcAOPHrpN aLxG/7xK45krPw374PlKuTzHF4KdEx6Qqahvq9ujChkSjpHiAovc4vRqAWh4AOdybdo51 mPfouVCgDFUleoLTkrpAeDNywfNnZOX8sI/2F7Drz2Hpi+mg4WBcE7KZXws/tj8RaE+tU jQ3XI/Gx7U5tPRaDHMXMgFgHukbhdj2W84rhkolpLGxtFa9Oi0PiLoI/irAEZa1uoQl26 0ZMVBw7knSIHAl469pFo40l6BJqjOabIHvqW9LrOMrq2oxr2fyb0OGCr1i4WdXbbqCw== 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=bckuey0Z; 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 754A4606A884; Fri, 13 Nov 2026 20:33:04 +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=bckuey0Z 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=1794601983; b=pcF7RG8IS3EMSSFpMZIRmmSm5/Mikee87YqPohYTaUnwK1Oy7ynGzX+C3sYeSORIjKhr yIFH/5O3T93JxgPVIO5GriMmyeunUHRWXGO1MudUwnhBX4rVHHEPISauzcNmr/hRU92Wz QN0nJ+LfnJiaMcODPtCaTTsKLsYK+6hit1Rt9pIYBn7+Lk09Zh6Yt1+IKRrcs7/G4tIcA HGoivNKH3Wt/LW+7rsjG5B1x9pY7P9EnjENz8zos8+yYf6tmMUWniV/froPPd8c3vo70m GShV0W4SZ0ptmkP/VHTzHDwdOxJFqT3dLHtQEu738mmJnyj4GAf0wel5bUAKz+6KyAA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794601983; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=KB3jO2Uh980sYfYogP8Ce6aR0qJaY2oratJHAC8zDpM=; b=JeD2j9t+o+BNSyNpdMe+97V5P7rmGrbCmbkZDS7RHR7a0DcqtqMXZBa3m5VS7xe6MUBO kXuGSxlEyIwfjE7jsGF8j7gyshmxJoRRBHWYxFpKBpJi/FiyA3T+u9jxxSb7X37JQ4dOO QumST+WSDj5cXjQYYDlIJc7OEUJUpDzv8/6ejFShKeyipspMo3Yi8sBe4RNakO19HIlM0 RM/tpXzhC5Wx89sjul2V0EonqvxByNz1rFVGGIrwg9kjIc5juPI2APUg/s2sKgG1aVhLm v0WJJ+2dNhe2ooWjyzP56vpF1DAefnkWZa0V6113sVCbIoLAuILNW7QjOpqUha3QRWw== 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=bckuey0Z; 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 538A1606A327; Fri, 13 Nov 2026 20:33:02 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 538A1606A327 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=KB3jO2Uh980sYfYogP8Ce6aR0qJaY2oratJHAC8zDpM=; b=bckuey0Z9y3l43ZbikGRihLCKL alpuVFssHwH4Vcv4s1nhWQILNGHj15E7P7hUv8oqbcqyWcjaTA12NdS+xvH5ogkyUvfBiPii+VfHY 5DxWfBoejA3LNErUg71EDJ4j5cSxdmFG0eWYIP7M2HZG6hxwJJWqInJo1DrbO9sOteMc=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xRxx9-00GMIW-Eu; Fri, 13 Nov 2026 21:32:55 +0100 X-Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, maxime.chevallier@bootlin.com, pavel@ucw.cz, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org, 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: <20261113110546.173624-4-a.shimko.dev@gmail.com>