[PATCH 2/3] usb: typec: tcpm/tcpci_maxim: drop CONFIG_OF

André Draszik posted 3 patches 3 months ago
[PATCH 2/3] usb: typec: tcpm/tcpci_maxim: drop CONFIG_OF
Posted by André Draszik 3 months ago
The general recommendation is to not use of_match_ptr() or CONFIG_OF
ifdef.

Drop them.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 drivers/usb/typec/tcpm/tcpci_maxim_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/typec/tcpm/tcpci_maxim_core.c b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
index ff3604be79da73ca5acff7b5b2434c116ed12ef8..43b0ec2d12ba6d4c1cfccbfd355af3e5d9ce1385 100644
--- a/drivers/usb/typec/tcpm/tcpci_maxim_core.c
+++ b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
@@ -563,18 +563,16 @@ static const struct i2c_device_id max_tcpci_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max_tcpci_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id max_tcpci_of_match[] = {
 	{ .compatible = "maxim,max33359", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, max_tcpci_of_match);
-#endif
 
 static struct i2c_driver max_tcpci_i2c_driver = {
 	.driver = {
 		.name = "maxtcpc",
-		.of_match_table = of_match_ptr(max_tcpci_of_match),
+		.of_match_table = max_tcpci_of_match,
 		.pm = &max_tcpci_pm_ops,
 	},
 	.probe = max_tcpci_probe,

-- 
2.50.0.727.gbf7dc18ff4-goog

Re: [PATCH 2/3] usb: typec: tcpm/tcpci_maxim: drop CONFIG_OF
Posted by Badhri Jagan Sridharan 2 months, 4 weeks ago
On Mon, Jul 7, 2025 at 3:50 AM André Draszik <andre.draszik@linaro.org> wrote:
>
> The general recommendation is to not use of_match_ptr() or CONFIG_OF
> ifdef.
>
> Drop them.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>

Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>

> ---
>  drivers/usb/typec/tcpm/tcpci_maxim_core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci_maxim_core.c b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
> index ff3604be79da73ca5acff7b5b2434c116ed12ef8..43b0ec2d12ba6d4c1cfccbfd355af3e5d9ce1385 100644
> --- a/drivers/usb/typec/tcpm/tcpci_maxim_core.c
> +++ b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
> @@ -563,18 +563,16 @@ static const struct i2c_device_id max_tcpci_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, max_tcpci_id);
>
> -#ifdef CONFIG_OF
>  static const struct of_device_id max_tcpci_of_match[] = {
>         { .compatible = "maxim,max33359", },
>         {},
>  };
>  MODULE_DEVICE_TABLE(of, max_tcpci_of_match);
> -#endif
>
>  static struct i2c_driver max_tcpci_i2c_driver = {
>         .driver = {
>                 .name = "maxtcpc",
> -               .of_match_table = of_match_ptr(max_tcpci_of_match),
> +               .of_match_table = max_tcpci_of_match,
>                 .pm = &max_tcpci_pm_ops,
>         },
>         .probe = max_tcpci_probe,
>
> --
> 2.50.0.727.gbf7dc18ff4-goog
>