Message ID | 20200628123654.32830-23-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> > > Whilst it's unlikely that this driver will ever be instantiated from > ACPI PRP0001 there is little advantage in using the of_match_ptr > protection. The switch of header is because we only use of_match_id > in here and that is defined in mod_devicetable.h not of.h. > > Note the main reason for this patch is to avoid providing instances > of of_match_ptr being used in IIO that might get copied into new drivers. > Commit message is misleading. The change won't help with ACPI due to syscon_regmap_lookup_by_phandle() call. > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> > --- > drivers/iio/adc/bcm_iproc_adc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c > index 936da32faa9d..44e1e53ada72 100644 > --- a/drivers/iio/adc/bcm_iproc_adc.c > +++ b/drivers/iio/adc/bcm_iproc_adc.c > @@ -4,7 +4,7 @@ > */ > > #include <linux/module.h> > -#include <linux/of.h> > +#include <linux/mod_devicetable.h> > #include <linux/io.h> > #include <linux/clk.h> > #include <linux/mfd/syscon.h> > @@ -617,7 +617,7 @@ static struct platform_driver iproc_adc_driver = { > .remove = iproc_adc_remove, > .driver = { > .name = "iproc-static-adc", > - .of_match_table = of_match_ptr(iproc_adc_of_match), > + .of_match_table = iproc_adc_of_match, > }, > }; > module_platform_driver(iproc_adc_driver); > -- > 2.27.0 >
On Tue, 30 Jun 2020 10:25:24 +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> > > > > Whilst it's unlikely that this driver will ever be instantiated from > > ACPI PRP0001 there is little advantage in using the of_match_ptr > > protection. The switch of header is because we only use of_match_id > > in here and that is defined in mod_devicetable.h not of.h. > > > > Note the main reason for this patch is to avoid providing instances > > of of_match_ptr being used in IIO that might get copied into new drivers. > > > > Commit message is misleading. The change won't help with ACPI due to > syscon_regmap_lookup_by_phandle() call. I'd missed that. I'll drop this one. Thanks, Jonathan > > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> > > --- > > drivers/iio/adc/bcm_iproc_adc.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c > > index 936da32faa9d..44e1e53ada72 100644 > > --- a/drivers/iio/adc/bcm_iproc_adc.c > > +++ b/drivers/iio/adc/bcm_iproc_adc.c > > @@ -4,7 +4,7 @@ > > */ > > > > #include <linux/module.h> > > -#include <linux/of.h> > > +#include <linux/mod_devicetable.h> > > #include <linux/io.h> > > #include <linux/clk.h> > > #include <linux/mfd/syscon.h> > > @@ -617,7 +617,7 @@ static struct platform_driver iproc_adc_driver = { > > .remove = iproc_adc_remove, > > .driver = { > > .name = "iproc-static-adc", > > - .of_match_table = of_match_ptr(iproc_adc_of_match), > > + .of_match_table = iproc_adc_of_match, > > }, > > }; > > module_platform_driver(iproc_adc_driver); > > -- > > 2.27.0 > > > >
On Sat, Jul 4, 2020 at 6:59 PM Jonathan Cameron <jic23@kernel.org> wrote: > > On Tue, 30 Jun 2020 10:25:24 +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> > > > > > > Whilst it's unlikely that this driver will ever be instantiated from > > > ACPI PRP0001 there is little advantage in using the of_match_ptr > > > protection. The switch of header is because we only use of_match_id > > > in here and that is defined in mod_devicetable.h not of.h. > > > > > > Note the main reason for this patch is to avoid providing instances > > > of of_match_ptr being used in IIO that might get copied into new drivers. > > > > > > > Commit message is misleading. The change won't help with ACPI due to > > syscon_regmap_lookup_by_phandle() call. > > I'd missed that. I'll drop this one. Actually in this case, if it's not done yet, I prefer to see in Kconfig something like depends on OF || COMPILE_TEST to explicitly show that "yes, you may compile it, but it requires OF to function with usefulness".
diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 936da32faa9d..44e1e53ada72 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b/drivers/iio/adc/bcm_iproc_adc.c @@ -4,7 +4,7 @@ */ #include <linux/module.h> -#include <linux/of.h> +#include <linux/mod_devicetable.h> #include <linux/io.h> #include <linux/clk.h> #include <linux/mfd/syscon.h> @@ -617,7 +617,7 @@ static struct platform_driver iproc_adc_driver = { .remove = iproc_adc_remove, .driver = { .name = "iproc-static-adc", - .of_match_table = of_match_ptr(iproc_adc_of_match), + .of_match_table = iproc_adc_of_match, }, }; module_platform_driver(iproc_adc_driver);