Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335930 > unrolled thread

[PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM

Started byAndrew Lunn <andrew@lunn.ch>
First post2016-02-17 00:50 +0100
Last post2016-02-17 11:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM Andrew Lunn <andrew@lunn.ch> - 2016-02-17 00:50 +0100
    Re: [PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing  the EEPROM Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-17 11:20 +0100

#1335930 — [PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM

FromAndrew Lunn <andrew@lunn.ch>
Date2016-02-17 00:50 +0100
Subject[PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM
Message-ID<r2Xxw-6pr-7@gated-at.bofh.it>
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>
---
 drivers/misc/eeprom/at25.c | 26 --------------------------
 include/linux/spi/eeprom.h |  2 --
 2 files changed, 28 deletions(-)

diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index f850ef556bcc..4732f6997289 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -29,7 +29,6 @@
 
 struct at25_data {
 	struct spi_device	*spi;
-	struct memory_accessor	mem;
 	struct mutex		lock;
 	struct spi_eeprom	chip;
 	struct bin_attribute	bin;
@@ -281,26 +280,6 @@ at25_bin_write(struct file *filp, struct kobject *kobj,
 
 /*-------------------------------------------------------------------------*/
 
-/* Let in-kernel code access the eeprom data. */
-
-static ssize_t at25_mem_read(struct memory_accessor *mem, char *buf,
-			 off_t offset, size_t count)
-{
-	struct at25_data *at25 = container_of(mem, struct at25_data, mem);
-
-	return at25_ee_read(at25, buf, offset, count);
-}
-
-static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf,
-			  off_t offset, size_t count)
-{
-	struct at25_data *at25 = container_of(mem, struct at25_data, mem);
-
-	return at25_ee_write(at25, buf, offset, count);
-}
-
-/*-------------------------------------------------------------------------*/
-
 static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)
 {
 	u32 val;
@@ -415,22 +394,17 @@ static int at25_probe(struct spi_device *spi)
 	at25->bin.attr.name = "eeprom";
 	at25->bin.attr.mode = S_IRUSR;
 	at25->bin.read = at25_bin_read;
-	at25->mem.read = at25_mem_read;
 
 	at25->bin.size = at25->chip.byte_len;
 	if (!(chip.flags & EE_READONLY)) {
 		at25->bin.write = at25_bin_write;
 		at25->bin.attr.mode |= S_IWUSR;
-		at25->mem.write = at25_mem_write;
 	}
 
 	err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin);
 	if (err)
 		return err;
 
-	if (chip.setup)
-		chip.setup(&at25->mem, chip.context);
-
 	dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n",
 		(at25->bin.size < 1024)
 			? 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 {
 	 */
 #define EE_INSTR_BIT3_IS_ADDR	0x0010
 
-	/* for exporting this chip's data to other kernel code */
-	void (*setup)(struct memory_accessor *mem, void *context);
 	void *context;
 };
 
-- 
2.7.0

[toc] | [next] | [standalone]


#1336200 — Re: [PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-02-17 11:20 +0100
SubjectRe: [PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM
Message-ID<r37nc-4W3-11@gated-at.bofh.it>
In reply to#1335930


On 16/02/16 23:41, Andrew Lunn wrote:
> 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>

Makes sense to clean this bits.. :-)

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
>   drivers/misc/eeprom/at25.c | 26 --------------------------
>   include/linux/spi/eeprom.h |  2 --
>   2 files changed, 28 deletions(-)
>
> diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
> index f850ef556bcc..4732f6997289 100644
> --- a/drivers/misc/eeprom/at25.c
> +++ b/drivers/misc/eeprom/at25.c
> @@ -29,7 +29,6 @@
>
>   struct at25_data {
>   	struct spi_device	*spi;
> -	struct memory_accessor	mem;
>   	struct mutex		lock;
>   	struct spi_eeprom	chip;
>   	struct bin_attribute	bin;
> @@ -281,26 +280,6 @@ at25_bin_write(struct file *filp, struct kobject *kobj,
>
>   /*-------------------------------------------------------------------------*/
>
> -/* Let in-kernel code access the eeprom data. */
> -
> -static ssize_t at25_mem_read(struct memory_accessor *mem, char *buf,
> -			 off_t offset, size_t count)
> -{
> -	struct at25_data *at25 = container_of(mem, struct at25_data, mem);
> -
> -	return at25_ee_read(at25, buf, offset, count);
> -}
> -
> -static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf,
> -			  off_t offset, size_t count)
> -{
> -	struct at25_data *at25 = container_of(mem, struct at25_data, mem);
> -
> -	return at25_ee_write(at25, buf, offset, count);
> -}
> -
> -/*-------------------------------------------------------------------------*/
> -
>   static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)
>   {
>   	u32 val;
> @@ -415,22 +394,17 @@ static int at25_probe(struct spi_device *spi)
>   	at25->bin.attr.name = "eeprom";
>   	at25->bin.attr.mode = S_IRUSR;
>   	at25->bin.read = at25_bin_read;
> -	at25->mem.read = at25_mem_read;
>
>   	at25->bin.size = at25->chip.byte_len;
>   	if (!(chip.flags & EE_READONLY)) {
>   		at25->bin.write = at25_bin_write;
>   		at25->bin.attr.mode |= S_IWUSR;
> -		at25->mem.write = at25_mem_write;
>   	}
>
>   	err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin);
>   	if (err)
>   		return err;
>
> -	if (chip.setup)
> -		chip.setup(&at25->mem, chip.context);
> -
>   	dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n",
>   		(at25->bin.size < 1024)
>   			? 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 {
>   	 */
>   #define EE_INSTR_BIT3_IS_ADDR	0x0010
>
> -	/* for exporting this chip's data to other kernel code */
> -	void (*setup)(struct memory_accessor *mem, void *context);
>   	void *context;
>   };
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web