diff mbox series

[v3,5/5] usb: typec: tcpci_rt1711h: Drop CONFIG_OF ifdeffery

Message ID 20230906080619.36930-6-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Commit f782152b2560e6a772a5c2f4022c70bb100cdcc3
Headers show
Series Match data improvements for rt1711h driver | expand

Commit Message

Biju Das Sept. 6, 2023, 8:06 a.m. UTC
Drop of_match_ptr() from rt1711h_of_match and get rid of ugly CONFIG_OF
ifdeffery. This slightly increases the size of rt1711h_of_match on non-OF
system and shouldn't be an issue.

It also allows, in case if needed, to enumerate this device via ACPI with
PRP0001 magic.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2->v3:
 * Added Rb tag from Andy.
 * Updated commit description for ACPI with PRP0001 magic.
v2:
 * New patch
---
 drivers/usb/typec/tcpm/tcpci_rt1711h.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Heikki Krogerus Sept. 8, 2023, 10:40 a.m. UTC | #1
On Wed, Sep 06, 2023 at 09:06:19AM +0100, Biju Das wrote:
> Drop of_match_ptr() from rt1711h_of_match and get rid of ugly CONFIG_OF
> ifdeffery. This slightly increases the size of rt1711h_of_match on non-OF
> system and shouldn't be an issue.
> 
> It also allows, in case if needed, to enumerate this device via ACPI with
> PRP0001 magic.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
> v2->v3:
>  * Added Rb tag from Andy.
>  * Updated commit description for ACPI with PRP0001 magic.
> v2:
>  * New patch
> ---
>  drivers/usb/typec/tcpm/tcpci_rt1711h.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> index 5d2dc7ead9d0..67422d45eb54 100644
> --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> @@ -7,6 +7,7 @@
>  
>  #include <linux/bits.h>
>  #include <linux/kernel.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
>  #include <linux/i2c.h>
>  #include <linux/interrupt.h>
> @@ -411,19 +412,17 @@ static const struct i2c_device_id rt1711h_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, rt1711h_id);
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id rt1711h_of_match[] = {
>  	{ .compatible = "richtek,rt1711h", .data = &rt1711h },
>  	{ .compatible = "richtek,rt1715", .data = &rt1715 },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, rt1711h_of_match);
> -#endif
>  
>  static struct i2c_driver rt1711h_i2c_driver = {
>  	.driver = {
>  		.name = "rt1711h",
> -		.of_match_table = of_match_ptr(rt1711h_of_match),
> +		.of_match_table = rt1711h_of_match,
>  	},
>  	.probe = rt1711h_probe,
>  	.remove = rt1711h_remove,
> -- 
> 2.25.1
diff mbox series

Patch

diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
index 5d2dc7ead9d0..67422d45eb54 100644
--- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
+++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
@@ -7,6 +7,7 @@ 
 
 #include <linux/bits.h>
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
@@ -411,19 +412,17 @@  static const struct i2c_device_id rt1711h_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, rt1711h_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id rt1711h_of_match[] = {
 	{ .compatible = "richtek,rt1711h", .data = &rt1711h },
 	{ .compatible = "richtek,rt1715", .data = &rt1715 },
 	{}
 };
 MODULE_DEVICE_TABLE(of, rt1711h_of_match);
-#endif
 
 static struct i2c_driver rt1711h_i2c_driver = {
 	.driver = {
 		.name = "rt1711h",
-		.of_match_table = of_match_ptr(rt1711h_of_match),
+		.of_match_table = rt1711h_of_match,
 	},
 	.probe = rt1711h_probe,
 	.remove = rt1711h_remove,