Re: [PATCH net v3 2/2] net: ethernet: ti: am65-cpsw: avoid devm_alloc_etherdev, fix module removal

From: Nicolas Pitre
Date: Sat Oct 05 2024 - 16:26:47 EST


On Fri, 4 Oct 2024, Roger Quadros wrote:

> > If you know of a way to do this differently I'm all ears.
>
> I sent another approach already. please check.
> https://lore.kernel.org/all/67c9ede4-9751-4255-b752-27dd60495ff3@xxxxxxxxxx/

Seems to work correctly.

Still... given this paragraph found in Documentation/process/maintainer-netdev.rst:

|Netdev remains skeptical about promises of all "auto-cleanup" APIs,
|including even ``devm_`` helpers, historically. They are not the preferred
|style of implementation, merely an acceptable one.

and given my solution is way simpler, I tend to also prefer it over yours.

But I'm not the maintainer nor even a significant contributor here so as
long as the issue is fixed I won't mind.

> > About the many error cases needing the freeing of net devices, as far as
> > I know they're all covered with this patch.
>
> No they are not.

As I said yesterday, I do still stand by my affirmation that they are.
Please look at the entire return path and you'll see that everything is
covered.


Nicolas