summaryrefslogtreecommitdiff
path: root/drivers/hwmon/adm1029.c
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe.montjoie@gmail.com>2019-01-18 15:03:26 +0100
committerGuenter Roeck <linux@roeck-us.net>2019-02-18 14:23:29 -0800
commit66b331ca2876914ffca44da574fa2453f3490742 (patch)
tree4d7f4afff904e5a092be0f5e731fe8ab7db9a3ff /drivers/hwmon/adm1029.c
parentb6c6d0cf4837f12f5eef98531871c1efd5da562a (diff)
hwmon: (adm1029) Add blank line after declarations
As requested by checkpatch, this patch adds a blank line after declarations Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/adm1029.c')
-rw-r--r--drivers/hwmon/adm1029.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c
index 092f16ad774f..f9f4f1f4a4c7 100644
--- a/drivers/hwmon/adm1029.c
+++ b/drivers/hwmon/adm1029.c
@@ -171,6 +171,7 @@ show_temp(struct device *dev, struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct adm1029_data *data = adm1029_update_device(dev);
+
return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[attr->index]));
}
@@ -180,6 +181,7 @@ show_fan(struct device *dev, struct device_attribute *devattr, char *buf)
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct adm1029_data *data = adm1029_update_device(dev);
u16 val;
+
if (data->fan[attr->index] == 0
|| (data->fan_div[attr->index] & 0xC0) == 0
|| data->fan[attr->index] == 255) {
@@ -196,6 +198,7 @@ show_fan_div(struct device *dev, struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct adm1029_data *data = adm1029_update_device(dev);
+
if ((data->fan_div[attr->index] & 0xC0) == 0)
return sprintf(buf, "0\n");
return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[attr->index]));
@@ -210,6 +213,7 @@ static ssize_t set_fan_div(struct device *dev,
u8 reg;
long val;
int ret = kstrtol(buf, 10, &val);
+
if (ret < 0)
return ret;