diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-09-11 16:36:33 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-09-24 00:08:35 -0400 |
commit | cc00e4ddbf00d5ee6d8b7df6d4b04d98f3d99af5 (patch) | |
tree | 3ee8c5464c89af8b79bca8fa5e9732dc78680cd0 /drivers/hwmon/adcxx.c | |
parent | e2d8c2b6de2db6d11afc661148b53691c2593f67 (diff) |
hwmon: (adcxx) Simplify show_name function
Display device name using to_spi_device(dev)->modalias instead of computing it
from the number of ADC channels. This is cleaner and reduces code size.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/adcxx.c')
-rw-r--r-- | drivers/hwmon/adcxx.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c index 111af7c4a3d4..f4c5867170d6 100644 --- a/drivers/hwmon/adcxx.c +++ b/drivers/hwmon/adcxx.c | |||
@@ -141,10 +141,7 @@ static ssize_t adcxx_set_max(struct device *dev, | |||
141 | static ssize_t adcxx_show_name(struct device *dev, struct device_attribute | 141 | static ssize_t adcxx_show_name(struct device *dev, struct device_attribute |
142 | *devattr, char *buf) | 142 | *devattr, char *buf) |
143 | { | 143 | { |
144 | struct spi_device *spi = to_spi_device(dev); | 144 | return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); |
145 | struct adcxx *adc = spi_get_drvdata(spi); | ||
146 | |||
147 | return sprintf(buf, "adcxx%ds\n", adc->channels); | ||
148 | } | 145 | } |
149 | 146 | ||
150 | static struct sensor_device_attribute ad_input[] = { | 147 | static struct sensor_device_attribute ad_input[] = { |