Re: [PATCH v3 08/10] iio: adc: ti-ads1015: Convert to OF match data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Mar 2022 11:24:12 +0200
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> On Sun, Mar 20, 2022 at 8:14 PM Marek Vasut <marex@xxxxxxx> wrote:
> >
> > Replace chip type enumeration in match data with pointer to static constant
> > structure which contain all the different chip properties in one place, and  
> 
> contains
> 
> > then replace handling of chip type in probe() with simple copy of fields in
> > the new match data structure into struct iio_dev.
> >
> > This reduces code and increases static data.  
> 
> I like this change! My comments below.
Nice work indeed. Nothing else from me on this one.

I like the fact you also got rid of some odd casting away of const
whilst you were doing this.

Jonathan

> 
> ...
> 
> > Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>  
> 
> If you use mine @kernel.org address it will be enough and reduces a
> lot of noise in the commit messages.
> 
> > Cc: Daniel Baluta <daniel.baluta@xxxxxxx>
> > Cc: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>  
> 
> ...
> 
> > +       chip = (const struct ads1015_chip_data *)
> > +               device_get_match_data(&client->dev);  
> 
> Redundant casting. After dropping it it will become one line.
> 
> > +       if (!chip)
> > +               chip = (const struct ads1015_chip_data *)id->driver_data;  
> 
> > +       if (!chip) {
> > +               dev_err(&client->dev, "Unknown chip\n");
> > +               return -EINVAL;  
> 
> return dev_err_probe(...);
> 
> > +       }  
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux