diff mbox series

[leds,v2,05/50] leds: various: guard of_match_table member value with of_match_ptr

Message ID 20200917223338.14164-6-marek.behun@nic.cz
State New
Headers show
Series None | expand

Commit Message

Marek Behún Sept. 17, 2020, 10:32 p.m. UTC
Change
  .of_match_table = xxx,
to
  .of_match_table = of_match_ptr(xxx),
in various drivers.

This should be standard even for drivers that depend on OF.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Sean Wang <sean.wang@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
---
 drivers/leds/leds-aat1290.c      | 2 +-
 drivers/leds/leds-as3645a.c      | 2 +-
 drivers/leds/leds-bcm6328.c      | 2 +-
 drivers/leds/leds-bcm6358.c      | 2 +-
 drivers/leds/leds-cpcap.c        | 2 +-
 drivers/leds/leds-cr0014114.c    | 2 +-
 drivers/leds/leds-el15203000.c   | 2 +-
 drivers/leds/leds-gpio.c         | 2 +-
 drivers/leds/leds-is31fl32xx.c   | 2 +-
 drivers/leds/leds-ktd2692.c      | 2 +-
 drivers/leds/leds-lm3532.c       | 2 +-
 drivers/leds/leds-lm3601x.c      | 2 +-
 drivers/leds/leds-lm3692x.c      | 2 +-
 drivers/leds/leds-lm3697.c       | 2 +-
 drivers/leds/leds-lp50xx.c       | 2 +-
 drivers/leds/leds-lp8860.c       | 2 +-
 drivers/leds/leds-max77650.c     | 2 +-
 drivers/leds/leds-max77693.c     | 2 +-
 drivers/leds/leds-mt6323.c       | 2 +-
 drivers/leds/leds-netxbig.c      | 2 +-
 drivers/leds/leds-pca955x.c      | 2 +-
 drivers/leds/leds-pca963x.c      | 2 +-
 drivers/leds/leds-pm8058.c       | 2 +-
 drivers/leds/leds-powernv.c      | 2 +-
 drivers/leds/leds-pwm.c          | 2 +-
 drivers/leds/leds-sc27xx-bltc.c  | 2 +-
 drivers/leds/leds-sgm3140.c      | 2 +-
 drivers/leds/leds-spi-byte.c     | 2 +-
 drivers/leds/leds-syscon.c       | 2 +-
 drivers/leds/leds-turris-omnia.c | 2 +-
 30 files changed, 30 insertions(+), 30 deletions(-)

Comments

Sakari Ailus Sept. 18, 2020, 6:15 a.m. UTC | #1
Hi Marek,

On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:
> Change

>   .of_match_table = xxx,

> to

>   .of_match_table = of_match_ptr(xxx),

> in various drivers.

> 

> This should be standard even for drivers that depend on OF.


After this patch, none of these drivers will work on ACPI systems anymore.

How many of them really depend on OF?

-- 
Regards,

Sakari Ailus
Marek Behún Sept. 18, 2020, 9:20 a.m. UTC | #2
On Fri, 18 Sep 2020 09:15:00 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> Hi Marek,
> 
> On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:
> > Change
> >   .of_match_table = xxx,
> > to
> >   .of_match_table = of_match_ptr(xxx),
> > in various drivers.
> > 
> > This should be standard even for drivers that depend on OF.  
> 
> After this patch, none of these drivers will work on ACPI systems anymore.

Hi Sakari,

I don't understand. Why not? Does ACPI subsystem parse of_match_table
as well?
Sakari Ailus Sept. 18, 2020, 9:57 a.m. UTC | #3
On Fri, Sep 18, 2020 at 11:20:58AM +0200, Marek Behun wrote:
> On Fri, 18 Sep 2020 09:15:00 +0300

> Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> 

> > Hi Marek,

> > 

> > On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:

> > > Change

> > >   .of_match_table = xxx,

> > > to

> > >   .of_match_table = of_match_ptr(xxx),

> > > in various drivers.

> > > 

> > > This should be standard even for drivers that depend on OF.  

> > 

> > After this patch, none of these drivers will work on ACPI systems anymore.


^

If CONFIG_OF is disabled, that is.

> 

> Hi Sakari,

> 

> I don't understand. Why not? Does ACPI subsystem parse of_match_table

> as well?


It does. The compatible string is used the same way as in DT for matching
devices with "PRP0001" _HID or _CID.

Please read Documentation/firmware-guide/acpi/enumeration.rst .

IOW, you can safely do the above only for drivers that depend on OF in
Kconfig. Otherwise you'll probably break something.

-- 
Sakari Ailus
Marek Behún Sept. 18, 2020, 10:10 a.m. UTC | #4
On Fri, 18 Sep 2020 12:57:59 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> On Fri, Sep 18, 2020 at 11:20:58AM +0200, Marek Behun wrote:
> > On Fri, 18 Sep 2020 09:15:00 +0300
> > Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> >   
> > > Hi Marek,
> > > 
> > > On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:  
> > > > Change
> > > >   .of_match_table = xxx,
> > > > to
> > > >   .of_match_table = of_match_ptr(xxx),
> > > > in various drivers.
> > > > 
> > > > This should be standard even for drivers that depend on OF.    
> > > 
> > > After this patch, none of these drivers will work on ACPI systems anymore.  
> 
> ^
> 
> If CONFIG_OF is disabled, that is.
> 
> > 
> > Hi Sakari,
> > 
> > I don't understand. Why not? Does ACPI subsystem parse of_match_table
> > as well?  
> 
> It does. The compatible string is used the same way as in DT for matching
> devices with "PRP0001" _HID or _CID.
> 
> Please read Documentation/firmware-guide/acpi/enumeration.rst .
> 
> IOW, you can safely do the above only for drivers that depend on OF in
> Kconfig. Otherwise you'll probably break something.
> 

Sakari, thank you for the pointer to the docs.
I thought that of_match_table is used only by OF (hence the name).

Marek
Lee Jones Sept. 28, 2020, 8:03 a.m. UTC | #5
On Fri, 18 Sep 2020, Sakari Ailus wrote:

> On Fri, Sep 18, 2020 at 11:20:58AM +0200, Marek Behun wrote:
> > On Fri, 18 Sep 2020 09:15:00 +0300
> > Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > 
> > > Hi Marek,
> > > 
> > > On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:
> > > > Change
> > > >   .of_match_table = xxx,
> > > > to
> > > >   .of_match_table = of_match_ptr(xxx),
> > > > in various drivers.
> > > > 
> > > > This should be standard even for drivers that depend on OF.  
> > > 
> > > After this patch, none of these drivers will work on ACPI systems anymore.
> 
> ^
> 
> If CONFIG_OF is disabled, that is.

What?  of_match_ptr() is designed to change depending on OF or !OF.

Are you confusing this with acpi_match_table()?

> > Hi Sakari,
> > 
> > I don't understand. Why not? Does ACPI subsystem parse of_match_table
> > as well?
> 
> It does. The compatible string is used the same way as in DT for matching
> devices with "PRP0001" _HID or _CID.
> 
> Please read Documentation/firmware-guide/acpi/enumeration.rst .

Could you allude to the specific line you are referencing please?

> IOW, you can safely do the above only for drivers that depend on OF in
> Kconfig. Otherwise you'll probably break something.
Lee Jones Sept. 28, 2020, 8:11 a.m. UTC | #6
On Mon, 28 Sep 2020, Lee Jones wrote:

> On Fri, 18 Sep 2020, Sakari Ailus wrote:
> 
> > On Fri, Sep 18, 2020 at 11:20:58AM +0200, Marek Behun wrote:
> > > On Fri, 18 Sep 2020 09:15:00 +0300
> > > Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > > 
> > > > Hi Marek,
> > > > 
> > > > On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:
> > > > > Change
> > > > >   .of_match_table = xxx,
> > > > > to
> > > > >   .of_match_table = of_match_ptr(xxx),
> > > > > in various drivers.
> > > > > 
> > > > > This should be standard even for drivers that depend on OF.  
> > > > 
> > > > After this patch, none of these drivers will work on ACPI systems anymore.
> > 
> > ^
> > 
> > If CONFIG_OF is disabled, that is.
> 
> What?  of_match_ptr() is designed to change depending on OF or !OF.
> 
> Are you confusing this with acpi_match_table()?

Okay, I just grepped the kernel and found some OF matching in the ACPI
bus code.  This seems odd to be (at first sight at least).  I'm not
entirely sure how this is supposed to work, but when you disable OF,
one could reasonably expect any matching utilising OF based tables to
be disabled too.

Not using of_match_ptr() on ACPI enabled platforms sounds batty to
me.  If this is valid, perhaps the of_match_ptr()semantics should be
changed to include ACPI.

> > > Hi Sakari,
> > > 
> > > I don't understand. Why not? Does ACPI subsystem parse of_match_table
> > > as well?
> > 
> > It does. The compatible string is used the same way as in DT for matching
> > devices with "PRP0001" _HID or _CID.
> > 
> > Please read Documentation/firmware-guide/acpi/enumeration.rst .
> 
> Could you allude to the specific line you are referencing please?
> 
> > IOW, you can safely do the above only for drivers that depend on OF in
> > Kconfig. Otherwise you'll probably break something.
>
Sakari Ailus Sept. 28, 2020, 9:37 a.m. UTC | #7
Hi Lee,

On Mon, Sep 28, 2020 at 09:11:14AM +0100, Lee Jones wrote:
> On Mon, 28 Sep 2020, Lee Jones wrote:
> 
> > On Fri, 18 Sep 2020, Sakari Ailus wrote:
> > 
> > > On Fri, Sep 18, 2020 at 11:20:58AM +0200, Marek Behun wrote:
> > > > On Fri, 18 Sep 2020 09:15:00 +0300
> > > > Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > > > 
> > > > > Hi Marek,
> > > > > 
> > > > > On Fri, Sep 18, 2020 at 12:32:53AM +0200, Marek Behún wrote:
> > > > > > Change
> > > > > >   .of_match_table = xxx,
> > > > > > to
> > > > > >   .of_match_table = of_match_ptr(xxx),
> > > > > > in various drivers.
> > > > > > 
> > > > > > This should be standard even for drivers that depend on OF.  
> > > > > 
> > > > > After this patch, none of these drivers will work on ACPI systems anymore.
> > > 
> > > ^
> > > 
> > > If CONFIG_OF is disabled, that is.
> > 
> > What?  of_match_ptr() is designed to change depending on OF or !OF.
> > 
> > Are you confusing this with acpi_match_table()?
> 
> Okay, I just grepped the kernel and found some OF matching in the ACPI
> bus code.  This seems odd to be (at first sight at least).  I'm not
> entirely sure how this is supposed to work, but when you disable OF,
> one could reasonably expect any matching utilising OF based tables to
> be disabled too.

There's really no reason having to enable the entire OF framework just to
allow compatible string matching.

> 
> Not using of_match_ptr() on ACPI enabled platforms sounds batty to
> me.  If this is valid, perhaps the of_match_ptr()semantics should be
> changed to include ACPI.

That'd be one option, yes. But not all drivers that work on both OF and
ACPI rely on the compatible strings on ACPI.

Another option could be adding a new macro, to set that table on both OF
and ACPI when needed? It could be called e.g. of_acpi_match_ptr(), for
instance.

Cc also linux-acpi list and Rafael.
diff mbox series

Patch

diff --git a/drivers/leds/leds-aat1290.c b/drivers/leds/leds-aat1290.c
index 5a0fe7b7b8bc7..c78a29ab8e9fb 100644
--- a/drivers/leds/leds-aat1290.c
+++ b/drivers/leds/leds-aat1290.c
@@ -545,7 +545,7 @@  static struct platform_driver aat1290_led_driver = {
 	.remove		= aat1290_led_remove,
 	.driver		= {
 		.name	= "aat1290",
-		.of_match_table = aat1290_led_dt_match,
+		.of_match_table = of_match_ptr(aat1290_led_dt_match),
 	},
 };
 
diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index e8922fa033796..50b12e440d88d 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -757,7 +757,7 @@  MODULE_DEVICE_TABLE(of, as3645a_of_table);
 
 static struct i2c_driver as3645a_i2c_driver = {
 	.driver	= {
-		.of_match_table = as3645a_of_table,
+		.of_match_table = of_match_ptr(as3645a_of_table),
 		.name = AS_NAME,
 	},
 	.probe_new	= as3645a_probe,
diff --git a/drivers/leds/leds-bcm6328.c b/drivers/leds/leds-bcm6328.c
index bad7efb751120..65a3857efa4ed 100644
--- a/drivers/leds/leds-bcm6328.c
+++ b/drivers/leds/leds-bcm6328.c
@@ -477,7 +477,7 @@  static struct platform_driver bcm6328_leds_driver = {
 	.probe = bcm6328_leds_probe,
 	.driver = {
 		.name = "leds-bcm6328",
-		.of_match_table = bcm6328_leds_of_match,
+		.of_match_table = of_match_ptr(bcm6328_leds_of_match),
 	},
 };
 
diff --git a/drivers/leds/leds-bcm6358.c b/drivers/leds/leds-bcm6358.c
index 94fefd456ba07..44fd1ba4be57e 100644
--- a/drivers/leds/leds-bcm6358.c
+++ b/drivers/leds/leds-bcm6358.c
@@ -220,7 +220,7 @@  static struct platform_driver bcm6358_leds_driver = {
 	.probe = bcm6358_leds_probe,
 	.driver = {
 		.name = "leds-bcm6358",
-		.of_match_table = bcm6358_leds_of_match,
+		.of_match_table = of_match_ptr(bcm6358_leds_of_match),
 	},
 };
 
diff --git a/drivers/leds/leds-cpcap.c b/drivers/leds/leds-cpcap.c
index 7d41ce8c9bb1e..263e4bbf3fda5 100644
--- a/drivers/leds/leds-cpcap.c
+++ b/drivers/leds/leds-cpcap.c
@@ -216,7 +216,7 @@  static struct platform_driver cpcap_led_driver = {
 	.probe = cpcap_led_probe,
 	.driver = {
 		.name = "cpcap-led",
-		.of_match_table = cpcap_led_of_match,
+		.of_match_table = of_match_ptr(cpcap_led_of_match),
 	},
 };
 module_platform_driver(cpcap_led_driver);
diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c
index 2da448ae718e9..a2f5638eda5f7 100644
--- a/drivers/leds/leds-cr0014114.c
+++ b/drivers/leds/leds-cr0014114.c
@@ -291,7 +291,7 @@  static struct spi_driver cr0014114_driver = {
 	.remove		= cr0014114_remove,
 	.driver = {
 		.name		= KBUILD_MODNAME,
-		.of_match_table	= cr0014114_dt_ids,
+		.of_match_table	= of_match_ptr(cr0014114_dt_ids),
 	},
 };
 
diff --git a/drivers/leds/leds-el15203000.c b/drivers/leds/leds-el15203000.c
index 298b13e4807a8..bcd13a7fc9d02 100644
--- a/drivers/leds/leds-el15203000.c
+++ b/drivers/leds/leds-el15203000.c
@@ -345,7 +345,7 @@  static struct spi_driver el15203000_driver = {
 	.remove		= el15203000_remove,
 	.driver = {
 		.name		= KBUILD_MODNAME,
-		.of_match_table	= el15203000_dt_ids,
+		.of_match_table	= of_match_ptr(el15203000_dt_ids),
 	},
 };
 
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index cf84096d88cec..aa740267eb232 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -311,7 +311,7 @@  static struct platform_driver gpio_led_driver = {
 	.shutdown	= gpio_led_shutdown,
 	.driver		= {
 		.name	= "leds-gpio",
-		.of_match_table = of_gpio_leds_match,
+		.of_match_table = of_match_ptr(of_gpio_leds_match),
 	},
 };
 
diff --git a/drivers/leds/leds-is31fl32xx.c b/drivers/leds/leds-is31fl32xx.c
index acf51e17e8df6..408eb5fad4cb0 100644
--- a/drivers/leds/leds-is31fl32xx.c
+++ b/drivers/leds/leds-is31fl32xx.c
@@ -485,7 +485,7 @@  MODULE_DEVICE_TABLE(i2c, is31fl32xx_id);
 static struct i2c_driver is31fl32xx_driver = {
 	.driver = {
 		.name	= "is31fl32xx",
-		.of_match_table = of_is31fl32xx_match,
+		.of_match_table = of_match_ptr(of_is31fl32xx_match),
 	},
 	.probe		= is31fl32xx_probe,
 	.remove		= is31fl32xx_remove,
diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c
index 670efee9b1317..63917db8cac39 100644
--- a/drivers/leds/leds-ktd2692.c
+++ b/drivers/leds/leds-ktd2692.c
@@ -402,7 +402,7 @@  MODULE_DEVICE_TABLE(of, ktd2692_match);
 static struct platform_driver ktd2692_driver = {
 	.driver = {
 		.name  = "ktd2692",
-		.of_match_table = ktd2692_match,
+		.of_match_table = of_match_ptr(ktd2692_match),
 	},
 	.probe  = ktd2692_probe,
 	.remove = ktd2692_remove,
diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c
index 946ad67eaecb7..3670cc64eee7b 100644
--- a/drivers/leds/leds-lm3532.c
+++ b/drivers/leds/leds-lm3532.c
@@ -752,7 +752,7 @@  static struct i2c_driver lm3532_i2c_driver = {
 	.id_table = lm3532_id,
 	.driver = {
 		.name = LM3532_NAME,
-		.of_match_table = of_lm3532_leds_match,
+		.of_match_table = of_match_ptr(of_lm3532_leds_match),
 	},
 };
 module_i2c_driver(lm3532_i2c_driver);
diff --git a/drivers/leds/leds-lm3601x.c b/drivers/leds/leds-lm3601x.c
index d0e1d4814042e..e12b9fbac4c1a 100644
--- a/drivers/leds/leds-lm3601x.c
+++ b/drivers/leds/leds-lm3601x.c
@@ -468,7 +468,7 @@  MODULE_DEVICE_TABLE(of, of_lm3601x_leds_match);
 static struct i2c_driver lm3601x_i2c_driver = {
 	.driver = {
 		.name = "lm3601x",
-		.of_match_table = of_lm3601x_leds_match,
+		.of_match_table = of_match_ptr(of_lm3601x_leds_match),
 	},
 	.probe_new = lm3601x_probe,
 	.remove = lm3601x_remove,
diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c
index 1d7ea1b76a125..ba535ee8fd252 100644
--- a/drivers/leds/leds-lm3692x.c
+++ b/drivers/leds/leds-lm3692x.c
@@ -525,7 +525,7 @@  MODULE_DEVICE_TABLE(of, of_lm3692x_leds_match);
 static struct i2c_driver lm3692x_driver = {
 	.driver = {
 		.name	= "lm3692x",
-		.of_match_table = of_lm3692x_leds_match,
+		.of_match_table = of_match_ptr(of_lm3692x_leds_match),
 	},
 	.probe		= lm3692x_probe,
 	.remove		= lm3692x_remove,
diff --git a/drivers/leds/leds-lm3697.c b/drivers/leds/leds-lm3697.c
index 024983088d599..5d14f3d2220af 100644
--- a/drivers/leds/leds-lm3697.c
+++ b/drivers/leds/leds-lm3697.c
@@ -379,7 +379,7 @@  MODULE_DEVICE_TABLE(of, of_lm3697_leds_match);
 static struct i2c_driver lm3697_driver = {
 	.driver = {
 		.name	= "lm3697",
-		.of_match_table = of_lm3697_leds_match,
+		.of_match_table = of_match_ptr(of_lm3697_leds_match),
 	},
 	.probe		= lm3697_probe,
 	.remove		= lm3697_remove,
diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index 47144a37cb945..1f8be335084d5 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -621,7 +621,7 @@  MODULE_DEVICE_TABLE(of, of_lp50xx_leds_match);
 static struct i2c_driver lp50xx_driver = {
 	.driver = {
 		.name	= "lp50xx",
-		.of_match_table = of_lp50xx_leds_match,
+		.of_match_table = of_match_ptr(of_lp50xx_leds_match),
 	},
 	.probe		= lp50xx_probe,
 	.remove		= lp50xx_remove,
diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index ac2f5d6272dc0..6eb323212da3c 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -484,7 +484,7 @@  MODULE_DEVICE_TABLE(of, of_lp8860_leds_match);
 static struct i2c_driver lp8860_driver = {
 	.driver = {
 		.name	= "lp8860",
-		.of_match_table = of_lp8860_leds_match,
+		.of_match_table = of_match_ptr(of_lp8860_leds_match),
 	},
 	.probe		= lp8860_probe,
 	.remove		= lp8860_remove,
diff --git a/drivers/leds/leds-max77650.c b/drivers/leds/leds-max77650.c
index a0d4b725c9178..56a37d4b7df63 100644
--- a/drivers/leds/leds-max77650.c
+++ b/drivers/leds/leds-max77650.c
@@ -144,7 +144,7 @@  MODULE_DEVICE_TABLE(of, max77650_led_of_match);
 static struct platform_driver max77650_led_driver = {
 	.driver = {
 		.name = "max77650-led",
-		.of_match_table = max77650_led_of_match,
+		.of_match_table = of_match_ptr(max77650_led_of_match),
 	},
 	.probe = max77650_led_probe,
 };
diff --git a/drivers/leds/leds-max77693.c b/drivers/leds/leds-max77693.c
index fec56090c2ba3..1d8e2ffe7ad46 100644
--- a/drivers/leds/leds-max77693.c
+++ b/drivers/leds/leds-max77693.c
@@ -1047,7 +1047,7 @@  static struct platform_driver max77693_led_driver = {
 	.remove		= max77693_led_remove,
 	.driver		= {
 		.name	= "max77693-led",
-		.of_match_table = max77693_led_dt_match,
+		.of_match_table = of_match_ptr(max77693_led_dt_match),
 	},
 };
 
diff --git a/drivers/leds/leds-mt6323.c b/drivers/leds/leds-mt6323.c
index 7b240771e45bb..80b57a39445cb 100644
--- a/drivers/leds/leds-mt6323.c
+++ b/drivers/leds/leds-mt6323.c
@@ -482,7 +482,7 @@  static struct platform_driver mt6323_led_driver = {
 	.remove		= mt6323_led_remove,
 	.driver		= {
 		.name	= "mt6323-led",
-		.of_match_table = mt6323_led_dt_match,
+		.of_match_table = of_match_ptr(mt6323_led_dt_match),
 	},
 };
 
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index ceceeb6a0e966..7f3313e321fa6 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -617,7 +617,7 @@  static struct platform_driver netxbig_led_driver = {
 	.probe		= netxbig_led_probe,
 	.driver		= {
 		.name		= "leds-netxbig",
-		.of_match_table	= of_netxbig_leds_match,
+		.of_match_table	= of_match_ptr(of_netxbig_leds_match),
 	},
 };
 
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
index 7087ca4592fc9..7da2b88a89197 100644
--- a/drivers/leds/leds-pca955x.c
+++ b/drivers/leds/leds-pca955x.c
@@ -579,7 +579,7 @@  static int pca955x_probe(struct i2c_client *client,
 static struct i2c_driver pca955x_driver = {
 	.driver = {
 		.name	= "leds-pca955x",
-		.of_match_table = of_pca955x_match,
+		.of_match_table = of_match_ptr(of_pca955x_match),
 	},
 	.probe	= pca955x_probe,
 	.id_table = pca955x_id,
diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c
index d288acbc99c7c..d3969c7914656 100644
--- a/drivers/leds/leds-pca963x.c
+++ b/drivers/leds/leds-pca963x.c
@@ -473,7 +473,7 @@  static int pca963x_remove(struct i2c_client *client)
 static struct i2c_driver pca963x_driver = {
 	.driver = {
 		.name	= "leds-pca963x",
-		.of_match_table = of_pca963x_match,
+		.of_match_table = of_match_ptr(of_pca963x_match),
 	},
 	.probe	= pca963x_probe,
 	.remove	= pca963x_remove,
diff --git a/drivers/leds/leds-pm8058.c b/drivers/leds/leds-pm8058.c
index 7869ccdf70ce6..d9e8ea80cd167 100644
--- a/drivers/leds/leds-pm8058.c
+++ b/drivers/leds/leds-pm8058.c
@@ -173,7 +173,7 @@  static struct platform_driver pm8058_led_driver = {
 	.probe		= pm8058_led_probe,
 	.driver		= {
 		.name	= "pm8058-leds",
-		.of_match_table = pm8058_leds_id_table,
+		.of_match_table = of_match_ptr(pm8058_leds_id_table),
 	},
 };
 module_platform_driver(pm8058_led_driver);
diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c
index cd43d5dff7f48..d803726300ff4 100644
--- a/drivers/leds/leds-powernv.c
+++ b/drivers/leds/leds-powernv.c
@@ -338,7 +338,7 @@  static struct platform_driver powernv_led_driver = {
 	.remove = powernv_led_remove,
 	.driver = {
 		.name = "powernv-led-driver",
-		.of_match_table = powernv_led_match,
+		.of_match_table = of_match_ptr(powernv_led_match),
 	},
 };
 
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index e35a97c1d8285..02c9c7a32251e 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -190,7 +190,7 @@  static struct platform_driver led_pwm_driver = {
 	.probe		= led_pwm_probe,
 	.driver		= {
 		.name	= "leds_pwm",
-		.of_match_table = of_pwm_leds_match,
+		.of_match_table = of_match_ptr(of_pwm_leds_match),
 	},
 };
 
diff --git a/drivers/leds/leds-sc27xx-bltc.c b/drivers/leds/leds-sc27xx-bltc.c
index 0ede87420bfc7..3401ad389c8d9 100644
--- a/drivers/leds/leds-sc27xx-bltc.c
+++ b/drivers/leds/leds-sc27xx-bltc.c
@@ -347,7 +347,7 @@  MODULE_DEVICE_TABLE(of, sc27xx_led_of_match);
 static struct platform_driver sc27xx_led_driver = {
 	.driver = {
 		.name = "sprd-bltc",
-		.of_match_table = sc27xx_led_of_match,
+		.of_match_table = of_match_ptr(sc27xx_led_of_match),
 	},
 	.probe = sc27xx_led_probe,
 	.remove = sc27xx_led_remove,
diff --git a/drivers/leds/leds-sgm3140.c b/drivers/leds/leds-sgm3140.c
index f4f831570f11c..92ce22024d91b 100644
--- a/drivers/leds/leds-sgm3140.c
+++ b/drivers/leds/leds-sgm3140.c
@@ -300,7 +300,7 @@  static struct platform_driver sgm3140_driver = {
 	.remove	= sgm3140_remove,
 	.driver	= {
 		.name	= "sgm3140",
-		.of_match_table = sgm3140_dt_match,
+		.of_match_table = of_match_ptr(sgm3140_dt_match),
 	},
 };
 
diff --git a/drivers/leds/leds-spi-byte.c b/drivers/leds/leds-spi-byte.c
index 9632eb84f8de1..21ec02c4f8dac 100644
--- a/drivers/leds/leds-spi-byte.c
+++ b/drivers/leds/leds-spi-byte.c
@@ -144,7 +144,7 @@  static struct spi_driver spi_byte_driver = {
 	.remove		= spi_byte_remove,
 	.driver = {
 		.name		= KBUILD_MODNAME,
-		.of_match_table	= spi_byte_dt_ids,
+		.of_match_table	= of_match_ptr(spi_byte_dt_ids),
 	},
 };
 
diff --git a/drivers/leds/leds-syscon.c b/drivers/leds/leds-syscon.c
index b58f3cafe16f4..b56a5c82bf759 100644
--- a/drivers/leds/leds-syscon.c
+++ b/drivers/leds/leds-syscon.c
@@ -134,7 +134,7 @@  static struct platform_driver syscon_led_driver = {
 	.probe		= syscon_led_probe,
 	.driver		= {
 		.name	= "leds-syscon",
-		.of_match_table = of_syscon_leds_match,
+		.of_match_table = of_match_ptr(of_syscon_leds_match),
 		.suppress_bind_attrs = true,
 	},
 };
diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
index bb23d8e166144..2a69d2085a225 100644
--- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c
@@ -284,7 +284,7 @@  static struct i2c_driver omnia_leds_driver = {
 	.id_table	= omnia_id,
 	.driver		= {
 		.name	= "leds-turris-omnia",
-		.of_match_table = of_omnia_leds_match,
+		.of_match_table = of_match_ptr(of_omnia_leds_match),
 	},
 };