Re: [net v2 1/1] net: ethernet: adi: adin1110: Fix notifiers

From: Russell King (Oracle)
Date: Thu Oct 20 2022 - 07:28:28 EST


Hi,

On Thu, Oct 20, 2022 at 12:48:04PM +0300, Alexandru Tachici wrote:
> @@ -1688,7 +1684,31 @@ static struct spi_driver adin1110_driver = {
> .probe = adin1110_probe,
> .id_table = adin1110_spi_id,
> };
> -module_spi_driver(adin1110_driver);
> +
> +static int __init adin1110_driver_init(void)
> +{
> + int err;
> +
> + err = spi_register_driver(&adin1110_driver);
> + if (err)
> + return err;

This is the point that devices can be bound and thus published to
userspace.

> +
> + err = adin1110_setup_notifiers();
> + if (err) {
> + spi_unregister_driver(&adin1110_driver);
> + return err;
> + }

And you setup the notifier after, so there is a window when
notifications could be lost. Is this safe?

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!