aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-02-26 14:59:21 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-01 19:55:48 -0500
commit3ccea0e1fdf896645f8cccddcfcf60cb289fdf76 (patch)
treefa1f3f4548bb67dfeb104e7de68ab360db575876
parent57d155506dd5e8f8242d0310d3822c486f70dea7 (diff)
eeprom: at25: Remove in kernel API for accessing the EEPROM
The setup() callback is not used by any in kernel code. Remove it. Any new code which requires access to the eeprom can use the NVMEM API. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/eeprom/at25.c26
-rw-r--r--include/linux/spi/eeprom.h2
2 files changed, 0 insertions, 28 deletions
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 3e9e5a28acaa..00f859cc0955 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -29,7 +29,6 @@
29 29
30struct at25_data { 30struct at25_data {
31 struct spi_device *spi; 31 struct spi_device *spi;
32 struct memory_accessor mem;
33 struct mutex lock; 32 struct mutex lock;
34 struct spi_eeprom chip; 33 struct spi_eeprom chip;
35 struct bin_attribute bin; 34 struct bin_attribute bin;
@@ -281,26 +280,6 @@ at25_bin_write(struct file *filp, struct kobject *kobj,
281 280
282/*-------------------------------------------------------------------------*/ 281/*-------------------------------------------------------------------------*/
283 282
284/* Let in-kernel code access the eeprom data. */
285
286static ssize_t at25_mem_read(struct memory_accessor *mem, char *buf,
287 off_t offset, size_t count)
288{
289 struct at25_data *at25 = container_of(mem, struct at25_data, mem);
290
291 return at25_ee_read(at25, buf, offset, count);
292}
293
294static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf,
295 off_t offset, size_t count)
296{
297 struct at25_data *at25 = container_of(mem, struct at25_data, mem);
298
299 return at25_ee_write(at25, buf, offset, count);
300}
301
302/*-------------------------------------------------------------------------*/
303
304static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip) 283static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)
305{ 284{
306 u32 val; 285 u32 val;
@@ -415,22 +394,17 @@ static int at25_probe(struct spi_device *spi)
415 at25->bin.attr.name = "eeprom"; 394 at25->bin.attr.name = "eeprom";
416 at25->bin.attr.mode = S_IRUSR; 395 at25->bin.attr.mode = S_IRUSR;
417 at25->bin.read = at25_bin_read; 396 at25->bin.read = at25_bin_read;
418 at25->mem.read = at25_mem_read;
419 397
420 at25->bin.size = at25->chip.byte_len; 398 at25->bin.size = at25->chip.byte_len;
421 if (!(chip.flags & EE_READONLY)) { 399 if (!(chip.flags & EE_READONLY)) {
422 at25->bin.write = at25_bin_write; 400 at25->bin.write = at25_bin_write;
423 at25->bin.attr.mode |= S_IWUSR; 401 at25->bin.attr.mode |= S_IWUSR;
424 at25->mem.write = at25_mem_write;
425 } 402 }
426 403
427 err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin); 404 err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin);
428 if (err) 405 if (err)
429 return err; 406 return err;
430 407
431 if (chip.setup)
432 chip.setup(&at25->mem, chip.context);
433
434 dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n", 408 dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n",
435 (at25->bin.size < 1024) 409 (at25->bin.size < 1024)
436 ? at25->bin.size 410 ? at25->bin.size
diff --git a/include/linux/spi/eeprom.h b/include/linux/spi/eeprom.h
index 403e007aef68..e34e169f9dcb 100644
--- a/include/linux/spi/eeprom.h
+++ b/include/linux/spi/eeprom.h
@@ -30,8 +30,6 @@ struct spi_eeprom {
30 */ 30 */
31#define EE_INSTR_BIT3_IS_ADDR 0x0010 31#define EE_INSTR_BIT3_IS_ADDR 0x0010
32 32
33 /* for exporting this chip's data to other kernel code */
34 void (*setup)(struct memory_accessor *mem, void *context);
35 void *context; 33 void *context;
36}; 34};
37 35