linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Andrew Lunn <andrew@lunn.ch>, GregKH <greg@kroah.com>,
	maxime.ripard@free-electrons.com, wsa@the-dreams.de,
	broonie@kernel.org, vz@mleia.com
Cc: afd@ti.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] eeprom: at25: Remove in kernel API for accessing the EEPROM
Date: Tue, 15 Dec 2015 10:04:16 +0000	[thread overview]
Message-ID: <566FE5A0.4050204@linaro.org> (raw)
In-Reply-To: <1449583511-22521-5-git-send-email-andrew@lunn.ch>



On 08/12/15 14:05, 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>
> ---
>   drivers/misc/eeprom/at25.c | 26 --------------------------
>   include/linux/spi/eeprom.h |  2 --
>   2 files changed, 28 deletions(-)
>

This is nice, The memory_accessor users can still use the 
nvmem_device_get() by passing the nvmem provider device_name which would 
give a handle to nvmem_device.


--srini
> 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;
>   };
>
>

  reply	other threads:[~2015-12-15 10:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 14:05 [PATCH 0/6] Convert existing EEPROM drivers to NVMEM Andrew Lunn
2015-12-08 14:05 ` [PATCH 1/6] nvmem: Add flag to export NVMEM to root only Andrew Lunn
2015-12-15 10:02   ` Srinivas Kandagatla
2015-12-08 14:05 ` [PATCH 2/6] nvmem: Add backwards compatibility support for older EEPROM drivers Andrew Lunn
2015-12-11 13:03   ` Wolfram Sang
2015-12-11 13:43     ` Andrew Lunn
2015-12-12 11:04       ` Wolfram Sang
2015-12-15 10:04     ` Srinivas Kandagatla
2015-12-15 10:04   ` Srinivas Kandagatla
2015-12-08 14:05 ` [PATCH 3/6] eeprom: at24: extend driver to plug into the NVMEM framework Andrew Lunn
2015-12-08 14:05 ` [PATCH 4/6] eeprom: at25: Remove in kernel API for accessing the EEPROM Andrew Lunn
2015-12-15 10:04   ` Srinivas Kandagatla [this message]
2015-12-08 14:05 ` [PATCH 5/6] eeprom: at25: extend driver to plug into the NVMEM framework Andrew Lunn
2015-12-08 14:05 ` [PATCH 6/6] eeprom: 93xx46: " Andrew Lunn
2015-12-15 10:05   ` Srinivas Kandagatla
2015-12-15 10:17     ` Andrew Lunn
2015-12-15 10:26       ` Srinivas Kandagatla
2015-12-15 10:37         ` Andrew Lunn
2015-12-15 10:47           ` Wolfram Sang
2015-12-15 10:51           ` Srinivas Kandagatla
2015-12-15 11:05         ` Anatolij Gustschin
2015-12-15 12:20           ` Srinivas Kandagatla
2015-12-15 10:06 ` [PATCH 0/6] Convert existing EEPROM drivers to NVMEM Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=566FE5A0.4050204@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=afd@ti.com \
    --cc=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=vz@mleia.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).