diff options
-rw-r--r-- | drivers/misc/ds1682.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/misc/ds1682.c b/drivers/misc/ds1682.c index b909fb30232a..c7112276a039 100644 --- a/drivers/misc/ds1682.c +++ b/drivers/misc/ds1682.c | |||
@@ -148,12 +148,6 @@ static ssize_t ds1682_eeprom_read(struct file *filp, struct kobject *kobj, | |||
148 | dev_dbg(&client->dev, "ds1682_eeprom_read(p=%p, off=%lli, c=%zi)\n", | 148 | dev_dbg(&client->dev, "ds1682_eeprom_read(p=%p, off=%lli, c=%zi)\n", |
149 | buf, off, count); | 149 | buf, off, count); |
150 | 150 | ||
151 | if (off >= DS1682_EEPROM_SIZE) | ||
152 | return 0; | ||
153 | |||
154 | if (off + count > DS1682_EEPROM_SIZE) | ||
155 | count = DS1682_EEPROM_SIZE - off; | ||
156 | |||
157 | rc = i2c_smbus_read_i2c_block_data(client, DS1682_REG_EEPROM + off, | 151 | rc = i2c_smbus_read_i2c_block_data(client, DS1682_REG_EEPROM + off, |
158 | count, buf); | 152 | count, buf); |
159 | if (rc < 0) | 153 | if (rc < 0) |
@@ -171,12 +165,6 @@ static ssize_t ds1682_eeprom_write(struct file *filp, struct kobject *kobj, | |||
171 | dev_dbg(&client->dev, "ds1682_eeprom_write(p=%p, off=%lli, c=%zi)\n", | 165 | dev_dbg(&client->dev, "ds1682_eeprom_write(p=%p, off=%lli, c=%zi)\n", |
172 | buf, off, count); | 166 | buf, off, count); |
173 | 167 | ||
174 | if (off >= DS1682_EEPROM_SIZE) | ||
175 | return -ENOSPC; | ||
176 | |||
177 | if (off + count > DS1682_EEPROM_SIZE) | ||
178 | count = DS1682_EEPROM_SIZE - off; | ||
179 | |||
180 | /* Write out to the device */ | 168 | /* Write out to the device */ |
181 | if (i2c_smbus_write_i2c_block_data(client, DS1682_REG_EEPROM + off, | 169 | if (i2c_smbus_write_i2c_block_data(client, DS1682_REG_EEPROM + off, |
182 | count, buf) < 0) | 170 | count, buf) < 0) |