From: Guenter Roeck Date: Tue, 11 Sep 2012 20:36:33 +0000 (-0700) Subject: hwmon: (adcxx) Simplify show_name function X-Git-Tag: next-20120920~83^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=87e6af8a0e57b46394c08db13efd545f3bea420d;p=karo-tx-linux.git 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 --- 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, static ssize_t adcxx_show_name(struct device *dev, struct device_attribute *devattr, char *buf) { - struct spi_device *spi = to_spi_device(dev); - struct adcxx *adc = spi_get_drvdata(spi); - - return sprintf(buf, "adcxx%ds\n", adc->channels); + return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); } static struct sensor_device_attribute ad_input[] = {