Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316007
b: refs/heads/master
c: f511a21
h: refs/heads/master
i:
  316005: f82a534
  316003: dd0d199
  315999: ed14daf
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent e9aee8c commit 733c493
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 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: bd91d3bab8787f53c1b937ac817b0c59f8146b97
refs/heads/master: f511a21f4ea7d4410241e15db5cb05a287812582
14 changes: 4 additions & 10 deletions trunk/drivers/hwmon/tmp102.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,16 @@ static int __devinit tmp102_probe(struct i2c_client *client,
return -ENODEV;
}

tmp102 = kzalloc(sizeof(*tmp102), GFP_KERNEL);
if (!tmp102) {
dev_dbg(&client->dev, "kzalloc failed\n");
tmp102 = devm_kzalloc(&client->dev, sizeof(*tmp102), GFP_KERNEL);
if (!tmp102)
return -ENOMEM;
}

i2c_set_clientdata(client, tmp102);

status = i2c_smbus_read_word_swapped(client, TMP102_CONF_REG);
if (status < 0) {
dev_err(&client->dev, "error reading config register\n");
goto fail_free;
return status;
}
tmp102->config_orig = status;
status = i2c_smbus_write_word_swapped(client, TMP102_CONF_REG,
Expand Down Expand Up @@ -213,9 +212,6 @@ static int __devinit tmp102_probe(struct i2c_client *client,
fail_restore_config:
i2c_smbus_write_word_swapped(client, TMP102_CONF_REG,
tmp102->config_orig);
fail_free:
kfree(tmp102);

return status;
}

Expand All @@ -236,8 +232,6 @@ static int __devexit tmp102_remove(struct i2c_client *client)
config | TMP102_CONF_SD);
}

kfree(tmp102);

return 0;
}

Expand Down

0 comments on commit 733c493

Please sign in to comment.