aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/max34440.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/pmbus/max34440.c')
-rw-r--r--drivers/hwmon/pmbus/max34440.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c
index fda621d2e458..beaf5a8d9c45 100644
--- a/drivers/hwmon/pmbus/max34440.c
+++ b/drivers/hwmon/pmbus/max34440.c
@@ -93,12 +93,14 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
93 93
94static int max34440_read_byte_data(struct i2c_client *client, int page, int reg) 94static int max34440_read_byte_data(struct i2c_client *client, int page, int reg)
95{ 95{
96 int ret; 96 int ret = 0;
97 int mfg_status; 97 int mfg_status;
98 98
99 ret = pmbus_set_page(client, page); 99 if (page >= 0) {
100 if (ret < 0) 100 ret = pmbus_set_page(client, page);
101 return ret; 101 if (ret < 0)
102 return ret;
103 }
102 104
103 switch (reg) { 105 switch (reg) {
104 case PMBUS_STATUS_IOUT: 106 case PMBUS_STATUS_IOUT:
@@ -224,7 +226,8 @@ static int max34440_probe(struct i2c_client *client,
224 226
225static int max34440_remove(struct i2c_client *client) 227static int max34440_remove(struct i2c_client *client)
226{ 228{
227 return pmbus_do_remove(client); 229 pmbus_do_remove(client);
230 return 0;
228} 231}
229 232
230static const struct i2c_device_id max34440_id[] = { 233static const struct i2c_device_id max34440_id[] = {