[PATCH] net: drop pointless .bind methods
Tom Rini
trini at konsulko.com
Mon Jul 13 22:54:35 CEST 2026
On Mon, Jul 13, 2026 at 09:30:43PM +0200, Rasmus Villemoes wrote:
> Considering that device_set_name() does
>
> int device_set_name(struct udevice *dev, const char *name)
> {
> name = strdup(name);
> if (!name)
> return -ENOMEM;
> dev->name = name;
> device_set_name_alloced(dev);
>
> return 0;
> }
>
> it should be pretty clear that these .bind methods are at best
> pointless (there's a fixup for device_set_name() en route that will
> make this not a memory leak).
>
> I presume one of them got added by mistake and the remaining are
> cargo-culted, but regardless, just remove them to prevent yet more
> copies of this anti-pattern to appear.
>
> Signed-off-by: Rasmus Villemoes <rv at rasmusvillemoes.dk>
Reviewed-by: Tom Rini <trini at konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260713/4330889c/attachment.sig>
More information about the U-Boot
mailing list