Re: [PATCH] net: stmmac: move notifier block to private data

From: David Miller
Date: Tue Feb 25 2020 - 14:10:34 EST


From: aaro.koskinen@xxxxxxxxx
Date: Tue, 25 Feb 2020 13:16:15 +0200

> From: Aaro Koskinen <aaro.koskinen@xxxxxxxxx>
>
> Move notifier block to private data. Otherwise notifier code will complain
> about double register with multiple stmmac instances.
>
> Fixes: 481a7d154cbb ("stmmac: debugfs entry name is not be changed when udev rename device name.")
> Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxxxxx>

This doesn't make any sense.

We need only one instance of the stmmac notifier registered, no matter how many
stmmac devices are probed.

Please change it such that we only call register_notifier() once (when the first
stmmac device is probed) and only unregister_notifier() when the last one is
removed.