aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adm1026.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/adm1026.c')
-rw-r--r--drivers/hwmon/adm1026.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index 625158110fd4..e0f56549d1d8 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -315,7 +315,7 @@ static struct i2c_driver adm1026_driver = {
315 .detach_client = adm1026_detach_client, 315 .detach_client = adm1026_detach_client,
316}; 316};
317 317
318int adm1026_attach_adapter(struct i2c_adapter *adapter) 318static int adm1026_attach_adapter(struct i2c_adapter *adapter)
319{ 319{
320 if (!(adapter->class & I2C_CLASS_HWMON)) { 320 if (!(adapter->class & I2C_CLASS_HWMON)) {
321 return 0; 321 return 0;
@@ -323,7 +323,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter)
323 return i2c_probe(adapter, &addr_data, adm1026_detect); 323 return i2c_probe(adapter, &addr_data, adm1026_detect);
324} 324}
325 325
326int adm1026_detach_client(struct i2c_client *client) 326static int adm1026_detach_client(struct i2c_client *client)
327{ 327{
328 struct adm1026_data *data = i2c_get_clientdata(client); 328 struct adm1026_data *data = i2c_get_clientdata(client);
329 hwmon_device_unregister(data->class_dev); 329 hwmon_device_unregister(data->class_dev);
@@ -332,7 +332,7 @@ int adm1026_detach_client(struct i2c_client *client)
332 return 0; 332 return 0;
333} 333}
334 334
335int adm1026_read_value(struct i2c_client *client, u8 reg) 335static int adm1026_read_value(struct i2c_client *client, u8 reg)
336{ 336{
337 int res; 337 int res;
338 338
@@ -346,7 +346,7 @@ int adm1026_read_value(struct i2c_client *client, u8 reg)
346 return res; 346 return res;
347} 347}
348 348
349int adm1026_write_value(struct i2c_client *client, u8 reg, int value) 349static int adm1026_write_value(struct i2c_client *client, u8 reg, int value)
350{ 350{
351 int res; 351 int res;
352 352
@@ -360,7 +360,7 @@ int adm1026_write_value(struct i2c_client *client, u8 reg, int value)
360 return res; 360 return res;
361} 361}
362 362
363void adm1026_init_client(struct i2c_client *client) 363static void adm1026_init_client(struct i2c_client *client)
364{ 364{
365 int value, i; 365 int value, i;
366 struct adm1026_data *data = i2c_get_clientdata(client); 366 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -460,7 +460,7 @@ void adm1026_init_client(struct i2c_client *client)
460 } 460 }
461} 461}
462 462
463void adm1026_print_gpio(struct i2c_client *client) 463static void adm1026_print_gpio(struct i2c_client *client)
464{ 464{
465 struct adm1026_data *data = i2c_get_clientdata(client); 465 struct adm1026_data *data = i2c_get_clientdata(client);
466 int i; 466 int i;
@@ -492,7 +492,7 @@ void adm1026_print_gpio(struct i2c_client *client)
492 } 492 }
493} 493}
494 494
495void adm1026_fixup_gpio(struct i2c_client *client) 495static void adm1026_fixup_gpio(struct i2c_client *client)
496{ 496{
497 struct adm1026_data *data = i2c_get_clientdata(client); 497 struct adm1026_data *data = i2c_get_clientdata(client);
498 int i; 498 int i;
@@ -1452,8 +1452,8 @@ static DEVICE_ATTR(temp1_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL);
1452static DEVICE_ATTR(temp2_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); 1452static DEVICE_ATTR(temp2_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL);
1453static DEVICE_ATTR(temp3_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); 1453static DEVICE_ATTR(temp3_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL);
1454 1454
1455int adm1026_detect(struct i2c_adapter *adapter, int address, 1455static int adm1026_detect(struct i2c_adapter *adapter, int address,
1456 int kind) 1456 int kind)
1457{ 1457{
1458 int company, verstep; 1458 int company, verstep;
1459 struct i2c_client *new_client; 1459 struct i2c_client *new_client;
@@ -1470,13 +1470,11 @@ int adm1026_detect(struct i2c_adapter *adapter, int address,
1470 client structure, even though we cannot fill it completely yet. 1470 client structure, even though we cannot fill it completely yet.
1471 But it allows us to access adm1026_{read,write}_value. */ 1471 But it allows us to access adm1026_{read,write}_value. */
1472 1472
1473 if (!(data = kmalloc(sizeof(struct adm1026_data), GFP_KERNEL))) { 1473 if (!(data = kzalloc(sizeof(struct adm1026_data), GFP_KERNEL))) {
1474 err = -ENOMEM; 1474 err = -ENOMEM;
1475 goto exit; 1475 goto exit;
1476 } 1476 }
1477 1477
1478 memset(data, 0, sizeof(struct adm1026_data));
1479
1480 new_client = &data->client; 1478 new_client = &data->client;
1481 i2c_set_clientdata(new_client, data); 1479 i2c_set_clientdata(new_client, data);
1482 new_client->addr = address; 1480 new_client->addr = address;