Skip to contentSkip to conversation

hwmon: (ltc4245) Remove devicetree conditionals

PATCH In review Guenter Roeck 2 participants 3 messages Feb 16, 2014 – Feb 23, 2014 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 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
index 0a3eddb..f67e967 100644
@@ -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
Reviewed-by on v1 3/3
#1 lore raw

Hi Guenter,

Quoted 22 lines · Guenter Roeck

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 -2
index 0a3eddb..f67e967 100644
@@ -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 -2
 		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;
 }

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
author maintainer
#2 lore raw
In reply to Guenter Roeck
Quoted 33 lines · Jean Delvare

Hi Guenter,

Quoted 30 lines · Guenter Roeck

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
index 0a3eddb..f67e967 100644
@@ -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 -0
  	return false;
  }

I am no OF expert but this looks good to me.

Thanks a lot!
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors