All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH 3/3] hwmon: (ltc4245) Remove devicetree conditionals
@ 2014-02-16  2:16 Guenter Roeck
  2014-02-23 11:25 ` Jean Delvare
  2014-02-23 16:39 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2014-02-16  2:16 UTC (permalink / raw)
  To: lm-sensors

Devicetree functions are stubbed out if CONFIG_OF is undefined.
Therefore, conditional compilation is unnecessary and can be removed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/ltc4245.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
index 0a3eddb..f67e967 100644
--- a/drivers/hwmon/ltc4245.c
+++ b/drivers/hwmon/ltc4245.c
@@ -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;
 }
-- 
1.7.9.7


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [lm-sensors] [PATCH 3/3] hwmon: (ltc4245) Remove devicetree conditionals
  2014-02-16  2:16 [lm-sensors] [PATCH 3/3] hwmon: (ltc4245) Remove devicetree conditionals Guenter Roeck
@ 2014-02-23 11:25 ` Jean Delvare
  2014-02-23 16:39 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2014-02-23 11:25 UTC (permalink / raw)
  To: lm-sensors

Hi Guenter,

On Sat, 15 Feb 2014 18:16:12 -0800, Guenter Roeck wrote:
> Devicetree functions are stubbed out if CONFIG_OF is undefined.
> Therefore, conditional compilation is unnecessary and can be removed.
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/hwmon/ltc4245.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
> index 0a3eddb..f67e967 100644
> --- a/drivers/hwmon/ltc4245.c
> +++ b/drivers/hwmon/ltc4245.c
> @@ -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;
>  }

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

Reviewed-by: Jean Delvare <jdelvare@suse.de>

-- 
Jean Delvare
Suse L3 Support

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lm-sensors] [PATCH 3/3] hwmon: (ltc4245) Remove devicetree conditionals
  2014-02-16  2:16 [lm-sensors] [PATCH 3/3] hwmon: (ltc4245) Remove devicetree conditionals Guenter Roeck
  2014-02-23 11:25 ` Jean Delvare
@ 2014-02-23 16:39 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2014-02-23 16:39 UTC (permalink / raw)
  To: lm-sensors

On 02/23/2014 03:25 AM, Jean Delvare wrote:
> Hi Guenter,
>
> On Sat, 15 Feb 2014 18:16:12 -0800, Guenter Roeck wrote:
>> Devicetree functions are stubbed out if CONFIG_OF is undefined.
>> Therefore, conditional compilation is unnecessary and can be removed.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>>   drivers/hwmon/ltc4245.c |    4 ----
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
>> index 0a3eddb..f67e967 100644
>> --- a/drivers/hwmon/ltc4245.c
>> +++ b/drivers/hwmon/ltc4245.c
>> @@ -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;
>>   }
>
> I am no OF expert but this looks good to me.
>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>

Thanks a lot!
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-23 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16  2:16 [lm-sensors] [PATCH 3/3] hwmon: (ltc4245) Remove devicetree conditionals Guenter Roeck
2014-02-23 11:25 ` Jean Delvare
2014-02-23 16:39 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.