Message ID | 20200628123654.32830-20-jic23@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio:adc more of_match_ptr and similar removal | expand |
On Sun, Jun 28, 2020 at 3:39 PM Jonathan Cameron <jic23@kernel.org> wrote: > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > There is no real advantage in this and it prevents use of > ACPI PRP0001. I'm also trying to clear this out of IIO in general > to avoid copying in new drivers. > > Include mod_devicetable.h as we are using of_device_id in here so > including that header is best practice. Similar comment as per previous patch. ACPI has an official ID at least for one component. So, we encourage vendors to provide proper ID. That said, the commit message is misleading a bit here (it might be useful for the components which are not supported by existing ACPI ID. > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com> > --- > drivers/iio/adc/ti-adc128s052.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c > index c1552b0fee04..cc3fb2d1686a 100644 > --- a/drivers/iio/adc/ti-adc128s052.c > +++ b/drivers/iio/adc/ti-adc128s052.c > @@ -13,6 +13,7 @@ > #include <linux/err.h> > #include <linux/spi/spi.h> > #include <linux/module.h> > +#include <linux/mod_devicetable.h> > #include <linux/iio/iio.h> > #include <linux/property.h> > #include <linux/regulator/consumer.h> > @@ -220,7 +221,7 @@ MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); > static struct spi_driver adc128_driver = { > .driver = { > .name = "adc128s052", > - .of_match_table = of_match_ptr(adc128_of_match), > + .of_match_table = adc128_of_match, > .acpi_match_table = ACPI_PTR(adc128_acpi_match), > }, > .probe = adc128_probe, > -- > 2.27.0 >
On Tue, 30 Jun 2020 10:22:45 +0300 Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Sun, Jun 28, 2020 at 3:39 PM Jonathan Cameron <jic23@kernel.org> wrote: > > > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > > > There is no real advantage in this and it prevents use of > > ACPI PRP0001. I'm also trying to clear this out of IIO in general > > to avoid copying in new drivers. > > > > Include mod_devicetable.h as we are using of_device_id in here so > > including that header is best practice. > > Similar comment as per previous patch. ACPI has an official ID at > least for one component. So, we encourage vendors to provide proper > ID. The problem is that not all vendors have an ACPI manufacturer ID (or a PNP one). They could probably get one but smaller manufacturers are never going to bother. > That said, the commit message is misleading a bit here (it might be > useful for the components which are not supported by existing ACPI ID. I'm a bit dubious about encouraging people to use an Intel ID. If it were issued by TI for a TI part that would be a different matter. Obviously there is no problem with Intel issuing an ID, or anyone else doing so. Jonathan > > > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com> > > --- > > drivers/iio/adc/ti-adc128s052.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c > > index c1552b0fee04..cc3fb2d1686a 100644 > > --- a/drivers/iio/adc/ti-adc128s052.c > > +++ b/drivers/iio/adc/ti-adc128s052.c > > @@ -13,6 +13,7 @@ > > #include <linux/err.h> > > #include <linux/spi/spi.h> > > #include <linux/module.h> > > +#include <linux/mod_devicetable.h> > > #include <linux/iio/iio.h> > > #include <linux/property.h> > > #include <linux/regulator/consumer.h> > > @@ -220,7 +221,7 @@ MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); > > static struct spi_driver adc128_driver = { > > .driver = { > > .name = "adc128s052", > > - .of_match_table = of_match_ptr(adc128_of_match), > > + .of_match_table = adc128_of_match, > > .acpi_match_table = ACPI_PTR(adc128_acpi_match), > > }, > > .probe = adc128_probe, > > -- > > 2.27.0 > > > >
On Sat, Jul 4, 2020 at 6:58 PM Jonathan Cameron <jic23@kernel.org> wrote: > On Tue, 30 Jun 2020 10:22:45 +0300 > Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > > On Sun, Jun 28, 2020 at 3:39 PM Jonathan Cameron <jic23@kernel.org> wrote: > The problem is that not all vendors have an ACPI manufacturer ID > (or a PNP one). They could probably get one but smaller manufacturers > are never going to bother. I understand and this is a real flaw in the ACPI process. But users (customers) should do something about it. > > That said, the commit message is misleading a bit here (it might be > > useful for the components which are not supported by existing ACPI ID. > > I'm a bit dubious about encouraging people to use an Intel ID. If it > were issued by TI for a TI part that would be a different matter. Here it's an ID corresponding to one of the supported components, so, PRP0001 makes sense for the rest. Rephrase the message to be more align with the reality (as per previous comment on the patch with same matter). > Obviously there is no problem with Intel issuing an ID, or anyone else > doing so.
diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c index c1552b0fee04..cc3fb2d1686a 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -13,6 +13,7 @@ #include <linux/err.h> #include <linux/spi/spi.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/iio/iio.h> #include <linux/property.h> #include <linux/regulator/consumer.h> @@ -220,7 +221,7 @@ MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); static struct spi_driver adc128_driver = { .driver = { .name = "adc128s052", - .of_match_table = of_match_ptr(adc128_of_match), + .of_match_table = adc128_of_match, .acpi_match_table = ACPI_PTR(adc128_acpi_match), }, .probe = adc128_probe,