Input: ads7846 - Use IS_ENABLED() macro
Subsystems (2)
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
Signed-off-by Fabio Estevam <[email protected]>
--- drivers/input/touchscreen/ads7846.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ads7846.c +2 -2
@@ -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
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Using the
IS_ENABLED()macro can make the code shorter and simplerSigned-off-by Fabio Estevam <[email protected]>
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@@ -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