diff options
author | Jean Delvare <khali@linux-fr.org> | 2006-01-09 17:07:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-02-06 15:02:15 -0500 |
commit | 0d0ab7fe4c009c40dc485731f9ad98e1d336ddae (patch) | |
tree | d459f9a5551643307c92a790969ea6a181cadc68 | |
parent | 806ba6409061ae49421319e3745026014abc49c2 (diff) |
[PATCH] hwmon: Inline w83792d register access functions
Inline w83792d_{read,write}_value for better performance.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Yuan Mu <Ymu@winbond.com.tw>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/hwmon/w83792d.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index b176bf0c4c7b..a2f6bb676235 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c | |||
@@ -303,10 +303,6 @@ struct w83792d_data { | |||
303 | static int w83792d_attach_adapter(struct i2c_adapter *adapter); | 303 | static int w83792d_attach_adapter(struct i2c_adapter *adapter); |
304 | static int w83792d_detect(struct i2c_adapter *adapter, int address, int kind); | 304 | static int w83792d_detect(struct i2c_adapter *adapter, int address, int kind); |
305 | static int w83792d_detach_client(struct i2c_client *client); | 305 | static int w83792d_detach_client(struct i2c_client *client); |
306 | |||
307 | static int w83792d_read_value(struct i2c_client *client, u8 register); | ||
308 | static int w83792d_write_value(struct i2c_client *client, u8 register, | ||
309 | u8 value); | ||
310 | static struct w83792d_data *w83792d_update_device(struct device *dev); | 306 | static struct w83792d_data *w83792d_update_device(struct device *dev); |
311 | 307 | ||
312 | #ifdef DEBUG | 308 | #ifdef DEBUG |
@@ -329,6 +325,20 @@ static inline long in_count_from_reg(int nr, struct w83792d_data *data) | |||
329 | return ((data->in[nr] << 2) | ((data->low_bits >> (2 * nr)) & 0x03)); | 325 | return ((data->in[nr] << 2) | ((data->low_bits >> (2 * nr)) & 0x03)); |
330 | } | 326 | } |
331 | 327 | ||
328 | /* The SMBus locks itself. The Winbond W83792D chip has a bank register, | ||
329 | but the driver only accesses registers in bank 0, so we don't have | ||
330 | to switch banks and lock access between switches. */ | ||
331 | static inline int w83792d_read_value(struct i2c_client *client, u8 reg) | ||
332 | { | ||
333 | return i2c_smbus_read_byte_data(client, reg); | ||
334 | } | ||
335 | |||
336 | static inline int | ||
337 | w83792d_write_value(struct i2c_client *client, u8 reg, u8 value) | ||
338 | { | ||
339 | return i2c_smbus_write_byte_data(client, reg, value); | ||
340 | } | ||
341 | |||
332 | /* following are the sysfs callback functions */ | 342 | /* following are the sysfs callback functions */ |
333 | static ssize_t show_in(struct device *dev, struct device_attribute *attr, | 343 | static ssize_t show_in(struct device *dev, struct device_attribute *attr, |
334 | char *buf) | 344 | char *buf) |
@@ -1386,19 +1396,6 @@ w83792d_detach_client(struct i2c_client *client) | |||
1386 | return 0; | 1396 | return 0; |
1387 | } | 1397 | } |
1388 | 1398 | ||
1389 | /* The SMBus locks itself. The Winbond W83792D chip has a bank register, | ||
1390 | but the driver only accesses registers in bank 0, so we don't have | ||
1391 | to switch banks and lock access between switches. */ | ||
1392 | static int w83792d_read_value(struct i2c_client *client, u8 reg) | ||
1393 | { | ||
1394 | return i2c_smbus_read_byte_data(client, reg); | ||
1395 | } | ||
1396 | |||
1397 | static int w83792d_write_value(struct i2c_client *client, u8 reg, u8 value) | ||
1398 | { | ||
1399 | return i2c_smbus_write_byte_data(client, reg, value); | ||
1400 | } | ||
1401 | |||
1402 | static void | 1399 | static void |
1403 | w83792d_init_client(struct i2c_client *client) | 1400 | w83792d_init_client(struct i2c_client *client) |
1404 | { | 1401 | { |