Skip to contentSkip to conversation

Input: ads7846 - Use IS_ENABLED() macro

PATCH Applied Fabio Estevam 2 participants 2 messages Dec 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: ads7846 - Use IS_ENABLED() macro

From: Fabio Estevam <[email protected]>

Using the IS_ENABLED() macro can make the code shorter and simpler

---
 drivers/input/touchscreen/ads7846.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ads7846.c +2 -2
index ea19536..5695786 100644
@@ -101,7 +101,7 @@ struct ads7846 {
 	struct spi_device	*spi;
 	struct regulator	*reg;
 
-#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
+#if IS_ENABLED(CONFIG_HWMON)
 	struct attribute_group	*attr_group;
 	struct device		*hwmon;
 #endif
@@ -421,7 +421,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command)
 	return status;
 }
 
-#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
+#if IS_ENABLED(CONFIG_HWMON)
 
 #define SHOW(name, var, adjust) static ssize_t \
 name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
Signature · 1 line
1.8.1.2
maintainer Applied
#1 lore raw
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Using the IS_ENABLED() macro can make the code shorter and simpler

Applied, thank you.

Quoted 29 lines
---
 drivers/input/touchscreen/ads7846.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ads7846.c +2 -2
index ea19536..5695786 100644
@@ -101,7 +101,7 @@ struct ads7846 {
 	struct spi_device	*spi;
 	struct regulator	*reg;
 
-#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
+#if IS_ENABLED(CONFIG_HWMON)
 	struct attribute_group	*attr_group;
 	struct device		*hwmon;
 #endif
@@ -421,7 +421,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command)
 	return status;
 }
 
-#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
+#if IS_ENABLED(CONFIG_HWMON)
 
 #define SHOW(name, var, adjust) static ssize_t \
 name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
Signature · 1 line
1.8.1.2
Signature · 1 line
Dmitry