diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 17:14:57 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 17:14:57 -0400 |
| commit | 20731945ae743034353a88c307920d1f16cf8ac8 (patch) | |
| tree | 132c796fe3a167dece8cec7a40b1d5dd83a68bc8 /drivers/hwmon/adm1026.c | |
| parent | 406119f49d4a6cf8b6eee639128e0575a95065e3 (diff) | |
| parent | a9d1b24d91f91b77db3da8aeacb414764f789b9c (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers/hwmon/adm1026.c')
| -rw-r--r-- | drivers/hwmon/adm1026.c | 22 |
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 | ||
| 318 | int adm1026_attach_adapter(struct i2c_adapter *adapter) | 318 | static 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 | ||
| 326 | int adm1026_detach_client(struct i2c_client *client) | 326 | static 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 | ||
| 335 | int adm1026_read_value(struct i2c_client *client, u8 reg) | 335 | static 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 | ||
| 349 | int adm1026_write_value(struct i2c_client *client, u8 reg, int value) | 349 | static 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 | ||
| 363 | void adm1026_init_client(struct i2c_client *client) | 363 | static 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 | ||
| 463 | void adm1026_print_gpio(struct i2c_client *client) | 463 | static 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 | ||
| 495 | void adm1026_fixup_gpio(struct i2c_client *client) | 495 | static 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); | |||
| 1452 | static DEVICE_ATTR(temp2_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); | 1452 | static DEVICE_ATTR(temp2_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); |
| 1453 | static DEVICE_ATTR(temp3_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); | 1453 | static DEVICE_ATTR(temp3_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); |
| 1454 | 1454 | ||
| 1455 | int adm1026_detect(struct i2c_adapter *adapter, int address, | 1455 | static 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; |
