Skip to content

Commit 15c5087

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit 15c5087

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/macintosh/windfarm_ad7417_sensor.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int wf_ad7417_temp_get(struct wf_sensor *sr, s32 *value)
5252
if (rc < 0)
5353
goto error;
5454

55-
/* Read a a 16-bit signed value */
55+
/* Read a 16-bit signed value */
5656
raw = be16_to_cpup((__le16 *)buf);
5757

5858
/* Convert 8.8-bit to 16.16 fixed point */
@@ -63,7 +63,7 @@ static int wf_ad7417_temp_get(struct wf_sensor *sr, s32 *value)
6363

6464
error:
6565
mutex_unlock(&pv->lock);
66-
return -1;
66+
return -EIO;
6767
}
6868

6969
/*
@@ -79,7 +79,7 @@ static int wf_ad7417_temp_get(struct wf_sensor *sr, s32 *value)
7979
static void wf_ad7417_adc_convert(struct wf_ad7417_priv *pv,
8080
int chan, s32 raw, s32 *value)
8181
{
82-
switch(chan) {
82+
switch (chan) {
8383
case 1: /* Diode */
8484
*value = (raw * (s32)pv->mpu->mdiode +
8585
((s32)pv->mpu->bdiode << 12)) >> 2;
@@ -128,7 +128,7 @@ static int wf_ad7417_adc_get(struct wf_sensor *sr, s32 *value)
128128
if (rc < 0)
129129
goto error;
130130

131-
/* Read a a 16-bit signed value */
131+
/* Read a 16-bit signed value */
132132
raw = be16_to_cpup((__le16 *)buf) >> 6;
133133
wf_ad7417_adc_convert(pv, chan, raw, value);
134134

@@ -141,12 +141,12 @@ static int wf_ad7417_adc_get(struct wf_sensor *sr, s32 *value)
141141

142142
error:
143143
dev_dbg(&pv->i2c->dev,
144-
"Error reading ADC, try %d...\n", i);
144+
"Error reading ADC, try %d...\n", i);
145145
if (i < 9)
146146
msleep(10);
147147
}
148148
mutex_unlock(&pv->lock);
149-
return -1;
149+
return -EIO;
150150
}
151151

152152
static void wf_ad7417_release(struct kref *ref)
@@ -261,7 +261,7 @@ static int wf_ad7417_probe(struct i2c_client *client)
261261
}
262262

263263
pv = kzalloc_obj(struct wf_ad7417_priv);
264-
if (pv == NULL)
264+
if (!pv)
265265
return -ENODEV;
266266

267267
kref_init(&pv->ref);

0 commit comments

Comments
 (0)