diff options
Diffstat (limited to 'drivers/hwmon/lm80.c')
| -rw-r--r-- | drivers/hwmon/lm80.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c index 83af8b3a0cac..c359fdea211e 100644 --- a/drivers/hwmon/lm80.c +++ b/drivers/hwmon/lm80.c | |||
| @@ -393,7 +393,7 @@ static int lm80_attach_adapter(struct i2c_adapter *adapter) | |||
| 393 | return i2c_probe(adapter, &addr_data, lm80_detect); | 393 | return i2c_probe(adapter, &addr_data, lm80_detect); |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | int lm80_detect(struct i2c_adapter *adapter, int address, int kind) | 396 | static int lm80_detect(struct i2c_adapter *adapter, int address, int kind) |
| 397 | { | 397 | { |
| 398 | int i, cur; | 398 | int i, cur; |
| 399 | struct i2c_client *new_client; | 399 | struct i2c_client *new_client; |
| @@ -407,11 +407,10 @@ int lm80_detect(struct i2c_adapter *adapter, int address, int kind) | |||
| 407 | /* OK. For now, we presume we have a valid client. We now create the | 407 | /* OK. For now, we presume we have a valid client. We now create the |
| 408 | client structure, even though we cannot fill it completely yet. | 408 | client structure, even though we cannot fill it completely yet. |
| 409 | But it allows us to access lm80_{read,write}_value. */ | 409 | But it allows us to access lm80_{read,write}_value. */ |
| 410 | if (!(data = kmalloc(sizeof(struct lm80_data), GFP_KERNEL))) { | 410 | if (!(data = kzalloc(sizeof(struct lm80_data), GFP_KERNEL))) { |
| 411 | err = -ENOMEM; | 411 | err = -ENOMEM; |
| 412 | goto exit; | 412 | goto exit; |
| 413 | } | 413 | } |
| 414 | memset(data, 0, sizeof(struct lm80_data)); | ||
| 415 | 414 | ||
| 416 | new_client = &data->client; | 415 | new_client = &data->client; |
| 417 | i2c_set_clientdata(new_client, data); | 416 | i2c_set_clientdata(new_client, data); |
