Re: [PATCH 06/18] serial: sc16is7xx: use spi_get_device_match_data()

From: Hugo Villeneuve
Date: Wed Dec 20 2023 - 17:22:46 EST


On Wed, 20 Dec 2023 17:44:52 +0200
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> 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.)

Done, devtype was already const.

>
> > + if (!devtype) {
> > + dev_err(&spi->dev, "Failed to match device\n");
> > + return -ENODEV;
>
> return dev_err_probe(...);
>
> ?

Yes, done for V2.

Also done the same two changes for the I2C part.

Hugo.