diff options
author | bgardner@wabtec.com <bgardner@wabtec.com> | 2005-07-27 13:43:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 12:14:06 -0400 |
commit | 17f990c87a1e5addc49b99a53b3d2a2fac9680e9 (patch) | |
tree | 6e17f13a5ce16299e20122d71450ca3a4c3db997 /drivers/i2c/chips/max6875.c | |
parent | 0283fe6c3bdbe9ca9aefa28b24883ec1dee3ccbd (diff) |
[PATCH] I2C: max6875 code cleanup
Remove an unused local variable and change the subclient name.
Signed-off-by: Ben Gardner <bgardner@wabtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/max6875.c')
-rw-r--r-- | drivers/i2c/chips/max6875.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index 35a8e9215294..f0e306237739 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c | |||
@@ -81,7 +81,6 @@ static void max6875_update_slice(struct i2c_client *client, int slice) | |||
81 | struct max6875_data *data = i2c_get_clientdata(client); | 81 | struct max6875_data *data = i2c_get_clientdata(client); |
82 | int i, j, addr; | 82 | int i, j, addr; |
83 | u8 *buf; | 83 | u8 *buf; |
84 | int retval = 0; | ||
85 | 84 | ||
86 | if (slice >= USER_EEPROM_SLICES) | 85 | if (slice >= USER_EEPROM_SLICES) |
87 | return; | 86 | return; |
@@ -102,7 +101,6 @@ static void max6875_update_slice(struct i2c_client *client, int slice) | |||
102 | /* select the eeprom address */ | 101 | /* select the eeprom address */ |
103 | if (i2c_smbus_write_byte_data(client, addr >> 8, addr & 0xFF)) { | 102 | if (i2c_smbus_write_byte_data(client, addr >> 8, addr & 0xFF)) { |
104 | dev_err(&client->dev, "address set failed\n"); | 103 | dev_err(&client->dev, "address set failed\n"); |
105 | retval = -1; | ||
106 | goto exit_up; | 104 | goto exit_up; |
107 | } | 105 | } |
108 | 106 | ||
@@ -111,14 +109,12 @@ static void max6875_update_slice(struct i2c_client *client, int slice) | |||
111 | if (i2c_smbus_read_i2c_block_data(client, | 109 | if (i2c_smbus_read_i2c_block_data(client, |
112 | MAX6875_CMD_BLK_READ, | 110 | MAX6875_CMD_BLK_READ, |
113 | buf) != SLICE_SIZE) { | 111 | buf) != SLICE_SIZE) { |
114 | retval = -1; | ||
115 | goto exit_up; | 112 | goto exit_up; |
116 | } | 113 | } |
117 | } else { | 114 | } else { |
118 | for (i = 0; i < SLICE_SIZE; i++) { | 115 | for (i = 0; i < SLICE_SIZE; i++) { |
119 | j = i2c_smbus_read_byte(client); | 116 | j = i2c_smbus_read_byte(client); |
120 | if (j < 0) { | 117 | if (j < 0) { |
121 | retval = -1; | ||
122 | goto exit_up; | 118 | goto exit_up; |
123 | } | 119 | } |
124 | buf[i] = j; | 120 | buf[i] = j; |
@@ -182,7 +178,7 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) | |||
182 | i2c_smbus_xfer(adapter, address, 0, 0, 0, | 178 | i2c_smbus_xfer(adapter, address, 0, 0, 0, |
183 | I2C_SMBUS_QUICK, NULL); | 179 | I2C_SMBUS_QUICK, NULL); |
184 | 180 | ||
185 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | 181 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
186 | | I2C_FUNC_SMBUS_READ_BYTE)) | 182 | | I2C_FUNC_SMBUS_READ_BYTE)) |
187 | return 0; | 183 | return 0; |
188 | 184 | ||
@@ -218,7 +214,7 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) | |||
218 | fake_client->adapter = adapter; | 214 | fake_client->adapter = adapter; |
219 | fake_client->driver = &max6875_driver; | 215 | fake_client->driver = &max6875_driver; |
220 | fake_client->flags = 0; | 216 | fake_client->flags = 0; |
221 | strlcpy(fake_client->name, "max6875-dummy", I2C_NAME_SIZE); | 217 | strlcpy(fake_client->name, "max6875 subclient", I2C_NAME_SIZE); |
222 | 218 | ||
223 | /* Prevent 24RF08 corruption (in case of user error) */ | 219 | /* Prevent 24RF08 corruption (in case of user error) */ |
224 | i2c_smbus_write_quick(real_client, 0); | 220 | i2c_smbus_write_quick(real_client, 0); |