Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350555
b: refs/heads/master
c: 77493ef
h: refs/heads/master
i:
  350553: 67e9205
  350551: 968d9d3
v: v3
  • Loading branch information
Guenter Roeck committed Feb 6, 2013
1 parent adfdd66 commit 8bbad03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ceeadc5c5187b78ffbea737c7a82ecc1e31e80df
refs/heads/master: 77493ef60f4586a58f83a3a00a55eeb733b4eff3
24 changes: 6 additions & 18 deletions trunk/drivers/hwmon/pmbus/pmbus_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1685,21 +1685,17 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
struct pmbus_data *data;
int ret;

if (!info) {
dev_err(&client->dev, "Missing chip information");
if (!info)
return -ENODEV;
}

if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE
| I2C_FUNC_SMBUS_BYTE_DATA
| I2C_FUNC_SMBUS_WORD_DATA))
return -ENODEV;

data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
if (!data) {
dev_err(&client->dev, "No memory to allocate driver data\n");
if (!data)
return -ENOMEM;
}

i2c_set_clientdata(client, data);
mutex_init(&data->update_lock);
Expand Down Expand Up @@ -1739,31 +1735,23 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
ret = -ENOMEM;
data->sensors = devm_kzalloc(&client->dev, sizeof(struct pmbus_sensor)
* data->max_sensors, GFP_KERNEL);
if (!data->sensors) {
dev_err(&client->dev, "No memory to allocate sensor data\n");
if (!data->sensors)
return -ENOMEM;
}

data->booleans = devm_kzalloc(&client->dev, sizeof(struct pmbus_boolean)
* data->max_booleans, GFP_KERNEL);
if (!data->booleans) {
dev_err(&client->dev, "No memory to allocate boolean data\n");
if (!data->booleans)
return -ENOMEM;
}

data->labels = devm_kzalloc(&client->dev, sizeof(struct pmbus_label)
* data->max_labels, GFP_KERNEL);
if (!data->labels) {
dev_err(&client->dev, "No memory to allocate label data\n");
if (!data->labels)
return -ENOMEM;
}

data->attributes = devm_kzalloc(&client->dev, sizeof(struct attribute *)
* data->max_attributes, GFP_KERNEL);
if (!data->attributes) {
dev_err(&client->dev, "No memory to allocate attribute data\n");
if (!data->attributes)
return -ENOMEM;
}

pmbus_find_attributes(client, data);

Expand Down

0 comments on commit 8bbad03

Please sign in to comment.