Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrew Lunn and committed by
Greg Kroah-Hartman
3ccea0e1 57d15550

-28
-26
drivers/misc/eeprom/at25.c
··· 29 29 30 30 struct at25_data { 31 31 struct spi_device *spi; 32 - struct memory_accessor mem; 33 32 struct mutex lock; 34 33 struct spi_eeprom chip; 35 34 struct bin_attribute bin; ··· 280 281 281 282 /*-------------------------------------------------------------------------*/ 282 283 283 - /* Let in-kernel code access the eeprom data. */ 284 - 285 - static ssize_t at25_mem_read(struct memory_accessor *mem, char *buf, 286 - off_t offset, size_t count) 287 - { 288 - struct at25_data *at25 = container_of(mem, struct at25_data, mem); 289 - 290 - return at25_ee_read(at25, buf, offset, count); 291 - } 292 - 293 - static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf, 294 - off_t offset, size_t count) 295 - { 296 - struct at25_data *at25 = container_of(mem, struct at25_data, mem); 297 - 298 - return at25_ee_write(at25, buf, offset, count); 299 - } 300 - 301 - /*-------------------------------------------------------------------------*/ 302 - 303 284 static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip) 304 285 { 305 286 u32 val; ··· 394 415 at25->bin.attr.name = "eeprom"; 395 416 at25->bin.attr.mode = S_IRUSR; 396 417 at25->bin.read = at25_bin_read; 397 - at25->mem.read = at25_mem_read; 398 418 399 419 at25->bin.size = at25->chip.byte_len; 400 420 if (!(chip.flags & EE_READONLY)) { 401 421 at25->bin.write = at25_bin_write; 402 422 at25->bin.attr.mode |= S_IWUSR; 403 - at25->mem.write = at25_mem_write; 404 423 } 405 424 406 425 err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin); 407 426 if (err) 408 427 return err; 409 - 410 - if (chip.setup) 411 - chip.setup(&at25->mem, chip.context); 412 428 413 429 dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n", 414 430 (at25->bin.size < 1024)
-2
include/linux/spi/eeprom.h
··· 30 30 */ 31 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 33 void *context; 36 34 }; 37 35