hwmon: (adt7475) Change valid parameter to bool type
authorTokunori Ikegami <ikegami@allied-telesis.co.jp>
Wed, 8 Aug 2018 01:32:17 +0000 (10:32 +0900)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 10 Aug 2018 16:13:01 +0000 (09:13 -0700)
Currently the valid variable is of type char, but it is used as boolean.
So let's change it to bool.

Signed-off-by: Tokunori Ikegami <ikegami@allied-telesis.co.jp>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
[groeck: Update description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/adt7475.c

index d6fe4ddd99275f43e659f220500e4ad01d5bb176..d90b31eb34722019ed773e389aeab1978bdca89a 100644 (file)
@@ -194,7 +194,7 @@ struct adt7475_data {
        struct mutex lock;
 
        unsigned long measure_updated;
-       char valid;
+       bool valid;
 
        u8 config4;
        u8 config5;
@@ -1781,6 +1781,7 @@ static struct adt7475_data *adt7475_update_device(struct device *dev)
            !data->valid) {
                adt7475_update_measure(dev);
                data->measure_updated = jiffies;
+               data->valid = true;
        }
 
        mutex_unlock(&data->lock);