Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc00e4dd authored by Guenter Roeck's avatar Guenter Roeck
Browse files

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: default avatarGuenter Roeck <linux@roeck-us.net>
parent e2d8c2b6
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -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
static ssize_t adcxx_show_name(struct device *dev, struct device_attribute
			      *devattr, char *buf)
			      *devattr, char *buf)
{
{
	struct spi_device *spi = to_spi_device(dev);
	return sprintf(buf, "%s\n", to_spi_device(dev)->modalias);
	struct adcxx *adc = spi_get_drvdata(spi);

	return sprintf(buf, "adcxx%ds\n", adc->channels);
}
}


static struct sensor_device_attribute ad_input[] = {
static struct sensor_device_attribute ad_input[] = {