Re: [PATCH 06/18] serial: sc16is7xx: use spi_get_device_match_data()
From: Andy Shevchenko
Date: Wed Dec 20 2023 - 10:45:16 EST
On Tue, Dec 19, 2023 at 12:18:50PM -0500, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@xxxxxxxxxxxx>
>
> Use preferred spi_get_device_match_data() instead of
> device_get_match_data() and spi_get_device_id() to get the driver match
> data.
...
> + devtype = (struct sc16is7xx_devtype *)spi_get_device_match_data(spi);
Nice one, but drop the casting. (Yes, make sure the assignee is const. It might
require an additional change.)
> + if (!devtype) {
> + dev_err(&spi->dev, "Failed to match device\n");
> + return -ENODEV;
return dev_err_probe(...);
?
> }
--
With Best Regards,
Andy Shevchenko