hwmon: (ltc4245) Remove devicetree conditionals
Guenter Roeck
maintainerPATCH 3/3 hwmon: (ltc4245) Remove devicetree conditionals
Devicetree functions are stubbed out if CONFIG_OF is undefined. Therefore, conditional compilation is unnecessary and can be removed.
--- drivers/hwmon/ltc4245.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/hwmon/ltc4245.c +0 -4
@@ -470,19 +470,15 @@ static void ltc4245_sysfs_add_groups(struct ltc4245_data *data)static bool ltc4245_use_extra_gpios (struct i2c_client *client) {struct ltc4245_platform_data *pdata =dev_get_platdata (&client->dev); -#ifdef CONFIG_OF struct device_node *np = client->dev.of_node; -#endif /* prefer platform data */ if (pdata)return pdata->use_extra_gpios; -#ifdef CONFIG_OF /* fallback on OF */ if (of_find_property (np,"ltc4245,use-extra-gpios" ,NULL ))return true; -#endif return false; }
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 22 lines · Guenter Roeck
Devicetree functions are stubbed out if
CONFIG_OFis undefined. Therefore, conditional compilation is unnecessary and can be removed.Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/ltc4245.c | 4 ---- 1 file changed, 4 deletions(-)drivers/hwmon/ltc4245.c +0
-2@@ -470,19 +470,15 @@ static void ltc4245_sysfs_add_groups(struct ltc4245_data *data)static bool ltc4245_use_extra_gpios (struct i2c_client *client) {struct ltc4245_platform_data *pdata =dev_get_platdata (&client->dev); -#ifdef CONFIG_OF struct device_node *np = client->dev.of_node; -#endif /* prefer platform data */ if (pdata)
drivers/hwmon/ltc4245.c static void ltc4245_sysfs_add_groups(struct ltc4245_data *data) · line 484
Quoted 10 lines
drivers/hwmon/ltc4245.c +0
-2return pdata->use_extra_gpios; -#ifdef CONFIG_OF /* fallback on OF */ if (of_find_property (np,"ltc4245,use-extra-gpios" ,NULL ))return true; -#endif return false; }
I am no OF expert but this looks good to me.
Signature · 7 lines
Jean Delvare Suse L3 Support _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 33 lines · Jean Delvare
Hi Guenter,
Quoted 30 lines · Guenter Roeck
Devicetree functions are stubbed out if
CONFIG_OFis undefined. Therefore, conditional compilation is unnecessary and can be removed.Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/ltc4245.c | 4 ---- 1 file changed, 4 deletions(-)drivers/hwmon/ltc4245.c +0
-4@@ -470,19 +470,15 @@ static void ltc4245_sysfs_add_groups(struct ltc4245_data *data)static bool ltc4245_use_extra_gpios (struct i2c_client *client) {struct ltc4245_platform_data *pdata =dev_get_platdata (&client->dev); -#ifdef CONFIG_OF struct device_node *np = client->dev.of_node; -#endif /* prefer platform data */ if (pdata)return pdata->use_extra_gpios; -#ifdef CONFIG_OF /* fallback on OF */ if (of_find_property (np,"ltc4245,use-extra-gpios" ,NULL ))return true; -#endif
Quoted 7 lines
drivers/hwmon/ltc4245.c static void ltc4245_sysfs_add_groups(struct ltc4245_data *data) · line 484
Quoted 2 lines
drivers/hwmon/ltc4245.c +0
-0return false; }I am no OF expert but this looks good to me.
Reviewed-by Jean Delvare <[email protected]>
Thanks a lot!
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors