Netdev List
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: ciprian.regus@analog.com,
	 Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	 Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-doc@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v2 10/10] net: ethernet: adi: Add a driver for the ADIN1140 MACPHY
Date: Mon, 1 Jun 2026 10:17:33 +0100	[thread overview]
Message-ID: <ah1NRk7Xu-ItYbgb@nsa> (raw)
In-Reply-To: <a272f9ae-1958-456f-b177-7c966694c047@lunn.ch>

On Fri, May 29, 2026 at 03:03:58PM +0200, Andrew Lunn wrote:
> Hi Nuno
> 
> > > +static void adin1140_stats_work(struct work_struct *work)
> > > +{
> > > +	struct delayed_work *dwork = to_delayed_work(work);
> > > +	u64 stat_buff[ADIN1140_STATS_CNT] = {};
> > > +	struct adin1140_priv *priv;
> > > +	u32 reg_val;
> > > +	int ret;
> > > +	u32 i;
> > > +
> > > +	priv = container_of(dwork, struct adin1140_priv, stats_work);
> > > +
> > > +	for (i = 0; i < ARRAY_SIZE(adin1140_stat_regs); i++) {
> > > +		ret = oa_tc6_read_register(priv->tc6, adin1140_stat_regs[i],
> > > +					   &reg_val);
> > > +		if (ret)
> > > +			break;
> > > +
> > > +		stat_buff[i] = reg_val;
> > > +	}
> > > +
> > > +	spin_lock(&priv->stat_lock);
> > 
> > Maybe consider using scoped_guard() and similar for other places?
> > Marginal win though so up to you.
> 
> Please trim the text when replying so just the needed context is
> provided. It is easy to miss comments when you need to repeatedly page
> down, page down, page down to find something.
> 

Sorry, I trimmed a bit but I guess not enough.

> > > +	ret = register_netdev(netdev);
> > > +	if (ret) {
> > > +		dev_err(&spi->dev, "Failed to register netdev (%d)", ret);
> > 
> > If we go to devm, this could be return dev_err_probe().
> 
> dev_err_probe() is not really about devm, but handling EPROBE_DEFFER,
> and not issues an error message when it is not wanted. I don't think

I know. I mixed a bit. I related it to devm because then we don't need
the error handling and then we can just do `return dev_err_probe()`.

> register_netdev() can return EPROBE_DEFFER, so it probably does not
> apply here.
>

And the above is a bit why I still like dev_err_probe() even if
EPROBE_DEFFER is not to be handled. I like that we can just return
rather than:

dev_err()
return ret;

Also it unifies error logs with the same style (for printing error
codes).

- Nuno Sá

>     Andrew

      reply	other threads:[~2026-06-01  9:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 21:51 [PATCH net-next v2 00/10] net: Add ADIN1140 support Ciprian Regus via B4 Relay
2026-05-26 21:51 ` [PATCH net-next v2 01/10] dt-bindings: net: Add ADIN1140 Ciprian Regus via B4 Relay
2026-05-27 15:11   ` Conor Dooley
2026-05-28 16:46     ` Regus, Ciprian
2026-05-28 17:18       ` Conor Dooley
2026-05-26 21:51 ` [PATCH net-next v2 02/10] net: ethernet: oa_tc6: Handle the OA TC6 SPI protected mode Ciprian Regus via B4 Relay
2026-05-26 21:51 ` [PATCH net-next v2 03/10] net: ethernet: oa_tc6: add OA_TC6_BROKEN_PHY quirk flag Ciprian Regus via B4 Relay
2026-05-28  2:12   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 04/10] net: ethernet: oa_tc6: Export the C45 access functions Ciprian Regus via B4 Relay
2026-05-28  2:13   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 05/10] net: ethernet: oa_tc6: Export standard defined registers Ciprian Regus via B4 Relay
2026-05-28  2:21   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 06/10] net: ethernet: oa_tc6: Add MMS register formatting macro Ciprian Regus via B4 Relay
2026-05-28  2:31   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 07/10] net: phy: add generic helpers for direct C45 MMD access Ciprian Regus via B4 Relay
2026-05-28  2:33   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 08/10] net: phy: microchip-t1s: use generic C45 MMD access helpers Ciprian Regus via B4 Relay
2026-05-28  2:33   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 09/10] net: phy: Add support for the ADIN1140 PHY Ciprian Regus via B4 Relay
2026-05-28  2:50   ` Andrew Lunn
2026-05-26 21:51 ` [PATCH net-next v2 10/10] net: ethernet: adi: Add a driver for the ADIN1140 MACPHY Ciprian Regus via B4 Relay
2026-05-28  3:10   ` Andrew Lunn
2026-05-28 12:43     ` Regus, Ciprian
2026-05-28 14:05       ` Andrew Lunn
2026-05-29  9:21   ` Nuno Sá
2026-05-29 13:03     ` Andrew Lunn
2026-06-01  9:17       ` Nuno Sá [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ah1NRk7Xu-ItYbgb@nsa \
    --to=noname.nuno@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=ciprian.regus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parthiban.veerasooran@microchip.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox