Re: [PATCH v2] spi: Don't have controller clean up spi device before driver unbind

From: Andy Shevchenko
Date: Wed May 05 2021 - 14:04:26 EST


On Wed, May 5, 2021 at 8:26 PM Saravana Kannan <saravanak@xxxxxxxxxx> wrote:
>
> When a spi device is unregistered and triggers a driver unbind, the
> driver might need to access the spi device. So, don't have the
> controller clean up the spi device before the driver is unbound. Clean
> up the spi device after the driver is unbound.
>
> Fixes: c7299fea6769 ("spi: Fix spi device unregister flow")
> Reported-by: Lukas Wunner <lukas@xxxxxxxxx>

And
Suggested-by: Lukas ...

> Signed-off-by: Saravana Kannan <saravanak@xxxxxxxxxx>

...

> Can you test this one your end to make sure you don't have issues
> anymore?

Do you need a test on my setup?

...

> + device_del(&spi->dev);
> + spi_cleanup(spi);
> + put_device(&spi->dev);

This block deserves a comment in the code.

--
With Best Regards,
Andy Shevchenko