diff mbox series

[V4,1/5] i2c: gpio: Fix potential unused warning for 'i2c_gpio_dt_ids'

Message ID fda9f8bc2477a3a49bd57ea219f88b4199c2163e.1669777792.git.zhoubinbin@loongson.cn
State New
Headers show
Series [V4,1/5] i2c: gpio: Fix potential unused warning for 'i2c_gpio_dt_ids' | expand

Commit Message

Binbin Zhou Nov. 30, 2022, 5:55 a.m. UTC
Dropping a matching #ifdef check along with dropping of_match_ptr()
is just a cleanup, while dropping of_match_ptr() that has no
corresponding #ifdef fixes an actual warning.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/i2c/busses/i2c-gpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Andy Shevchenko Nov. 30, 2022, 8:29 p.m. UTC | #1
On Wed, Nov 30, 2022 at 01:55:51PM +0800, Binbin Zhou wrote:
> Dropping a matching #ifdef check along with dropping of_match_ptr()
> is just a cleanup, while dropping of_match_ptr() that has no
> corresponding #ifdef fixes an actual warning.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  drivers/i2c/busses/i2c-gpio.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> index b1985c1667e1..0e4385a9bcf7 100644
> --- a/drivers/i2c/busses/i2c-gpio.c
> +++ b/drivers/i2c/busses/i2c-gpio.c
> @@ -482,19 +482,17 @@ static int i2c_gpio_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#if defined(CONFIG_OF)
>  static const struct of_device_id i2c_gpio_dt_ids[] = {
>  	{ .compatible = "i2c-gpio", },
>  	{ /* sentinel */ }
>  };
>  
>  MODULE_DEVICE_TABLE(of, i2c_gpio_dt_ids);
> -#endif
>  
>  static struct platform_driver i2c_gpio_driver = {
>  	.driver		= {
>  		.name	= "i2c-gpio",
> -		.of_match_table	= of_match_ptr(i2c_gpio_dt_ids),
> +		.of_match_table	= i2c_gpio_dt_ids,
>  	},
>  	.probe		= i2c_gpio_probe,
>  	.remove		= i2c_gpio_remove,
> -- 
> 2.31.1
>
Wolfram Sang Dec. 5, 2022, 9:29 a.m. UTC | #2
On Wed, Nov 30, 2022 at 01:55:51PM +0800, Binbin Zhou wrote:
> Dropping a matching #ifdef check along with dropping of_match_ptr()
> is just a cleanup, while dropping of_match_ptr() that has no
> corresponding #ifdef fixes an actual warning.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index b1985c1667e1..0e4385a9bcf7 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -482,19 +482,17 @@  static int i2c_gpio_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#if defined(CONFIG_OF)
 static const struct of_device_id i2c_gpio_dt_ids[] = {
 	{ .compatible = "i2c-gpio", },
 	{ /* sentinel */ }
 };
 
 MODULE_DEVICE_TABLE(of, i2c_gpio_dt_ids);
-#endif
 
 static struct platform_driver i2c_gpio_driver = {
 	.driver		= {
 		.name	= "i2c-gpio",
-		.of_match_table	= of_match_ptr(i2c_gpio_dt_ids),
+		.of_match_table	= i2c_gpio_dt_ids,
 	},
 	.probe		= i2c_gpio_probe,
 	.remove		= i2c_gpio_remove,