Skip to contentSkip to conversation

hwmon: (pwm-fan) Make SENSORS_PWM_FAN depend on OF

PATCH In review Axel Lin 3 participants 3 messages Jul 25, 2014 Hardware monitoring

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 hwmon: (pwm-fan) Make SENSORS_PWM_FAN depend on OF

This driver won't instantiate if OF is not configured, thus add OF dependency. Also add COMPILE_TEST to increase build testing coverage.

---
 drivers/hwmon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/Kconfig +1 -1
index b93ab97..b9a2764 100644
@@ -1130,7 +1130,7 @@ source drivers/hwmon/pmbus/Kconfig
 
 config SENSORS_PWM_FAN
 	tristate "PWM fan"
-	depends on PWM
+	depends on (PWM && OF) || COMPILE_TEST
 	help
 	  If you say yes here you get support for fans connected to PWM lines.
 	  The driver uses the generic PWM interface, thus it will work on a
Signature · 9 lines
1.9.1




_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Reviewed-by on v1 1/1
#1 lore raw

Hi Axel,

Quoted 13 lines · Axel Lin

This driver won't instantiate if OF is not configured, thus add OF dependency. Also add COMPILE_TEST to increase build testing coverage.

---
 drivers/hwmon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/Kconfig +0 -0
index b93ab97..b9a2764 100644

drivers/hwmon/Kconfig source drivers/hwmon/pmbus/Kconfig · line 1136

Quoted 8 lines
drivers/hwmon/Kconfig +1 -1
@@ -1130,7 +1130,7 @@ source drivers/hwmon/pmbus/Kconfig
 
 config SENSORS_PWM_FAN
 	tristate "PWM fan"
-	depends on PWM
+	depends on (PWM && OF) || COMPILE_TEST
 	help
 	  If you say yes here you get support for fans connected to PWM lines.
 	  The driver uses the generic PWM interface, thus it will work on a

Does the driver build without PWM? If it does then the patch is correct and you can add:

If it does not then you have to leave PWM as a functional dependency, which would lead to:

	depends on PWM
	depends on OF || COMPILE_TEST

It is allowed to have multiple depends statements, and even encouraged when you have both functional dependencies and run-time dependencies. I can't test, so please do.

Thanks,

Signature · 7 lines
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#2 lore raw
In reply to Axel Lin
Quoted 17 lines · Jean Delvare

Hi Axel,

Quoted 14 lines · Axel Lin

This driver won't instantiate if OF is not configured, thus add OF dependency. Also add COMPILE_TEST to increase build testing coverage.

---
 drivers/hwmon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/Kconfig +0 -0
index b93ab97..b9a2764 100644
@@ -1130,7 +1130,7 @@ source drivers/hwmon/pmbus/Kconfig
 
Quoted 11 lines

drivers/hwmon/Kconfig source drivers/hwmon/pmbus/Kconfig · line 1136

Quoted 7 lines
drivers/hwmon/Kconfig +1 -1
 config SENSORS_PWM_FAN
 	tristate "PWM fan"
-	depends on PWM
+	depends on (PWM && OF) || COMPILE_TEST
 	help
 	  If you say yes here you get support for fans connected to PWM lines.
 	  The driver uses the generic PWM interface, thus it will work on a

Does the driver build without PWM? If it does then the patch is correct and you can add:

Yes, it does build. To test it, I removed the PWM dependency, disabled PWM, and tried to build it. I did this with CONFIG_OF enabled and disabled (with arm as target). All variants passed, so I think we should be ok.

I'll apply the patch and run it through my full suite of builds. That should hopefully tell us if there are any problems.

Quoted 2 lines

Thanks!

Guenter

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