diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/pmbus/zl6100.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c index 48c7b4a716ae..880b90cf4d32 100644 --- a/drivers/hwmon/pmbus/zl6100.c +++ b/drivers/hwmon/pmbus/zl6100.c | |||
@@ -33,6 +33,7 @@ enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 }; | |||
33 | struct zl6100_data { | 33 | struct zl6100_data { |
34 | int id; | 34 | int id; |
35 | ktime_t access; /* chip access time */ | 35 | ktime_t access; /* chip access time */ |
36 | int delay; /* Delay between chip accesses in uS */ | ||
36 | struct pmbus_driver_info info; | 37 | struct pmbus_driver_info info; |
37 | }; | 38 | }; |
38 | 39 | ||
@@ -52,10 +53,10 @@ MODULE_PARM_DESC(delay, "Delay between chip accesses in uS"); | |||
52 | /* Some chips need a delay between accesses */ | 53 | /* Some chips need a delay between accesses */ |
53 | static inline void zl6100_wait(const struct zl6100_data *data) | 54 | static inline void zl6100_wait(const struct zl6100_data *data) |
54 | { | 55 | { |
55 | if (delay) { | 56 | if (data->delay) { |
56 | s64 delta = ktime_us_delta(ktime_get(), data->access); | 57 | s64 delta = ktime_us_delta(ktime_get(), data->access); |
57 | if (delta < delay) | 58 | if (delta < data->delay) |
58 | udelay(delay - delta); | 59 | udelay(data->delay - delta); |
59 | } | 60 | } |
60 | } | 61 | } |
61 | 62 | ||
@@ -207,8 +208,9 @@ static int zl6100_probe(struct i2c_client *client, | |||
207 | * can be cleared later for additional chips if tests show that it | 208 | * can be cleared later for additional chips if tests show that it |
208 | * is not needed (in other words, better be safe than sorry). | 209 | * is not needed (in other words, better be safe than sorry). |
209 | */ | 210 | */ |
211 | data->delay = delay; | ||
210 | if (data->id == zl2004 || data->id == zl6105) | 212 | if (data->id == zl2004 || data->id == zl6105) |
211 | delay = 0; | 213 | data->delay = 0; |
212 | 214 | ||
213 | /* | 215 | /* |
214 | * Since there was a direct I2C device access above, wait before | 216 | * Since there was a direct I2C device access above, wait before |