[PATCH net-next v2 01/11] net: stmmac: Make stmmac_pltfr_remove() return void

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon May 8 10:19:07 PDT 2023


Hello,

On Mon, May 08, 2023 at 02:47:36PM +0000, Peppe CAVALLARO wrote:
> Thx for this patch train, maybe I missed the cover letter. In my
> opinion the proposed change is intrusive but I can accept. It could be
> great to enhance the platform remove functions to fail in case of an
> expected case occurs.

Not sure I understand what you want. platform_remove() (i.e. the caller
of the remove callback) emits a warning if .remove() returns an value !=
0.

In the Linux driver model remove functions are not supposed to fail. The
most usual case for a driver unbind (aka remove) is that the device in
question disappeared (think hotplug). There is no value in failing, what
should happen if the driver fails? There is no chance to reenter
.remove() as some resources might already be freed.

> +	.remove_new = stmmac_pltfr_remove,
> 
> To be honest, I do not like to see: ".remove_new" as hook

.remove_new() is not here to say. Once all drivers are converted,
.remove() is changed to get the same semantics as .remove_new() has now
and then after all drivers are converted back to .remove() .remove_new()
will be dropped. See 5c5a7680e67ba6fbbb5f4d79fa41485450c1985c for some
more details.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20230508/bf6a235a/attachment.sig>


More information about the linux-arm-kernel mailing list