All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Joachim Eastwood <manabian@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>, Chen-Yu Tsai <wens@csie.org>,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 02/12] eeprom: at24: remove nvmem regmap dependency
Date: Wed, 4 May 2016 03:32:12 +0200	[thread overview]
Message-ID: <20160504013212.GA7972@lunn.ch> (raw)
In-Reply-To: <20160502073254.GA2015@tetsubishi>

On Mon, May 02, 2016 at 09:32:54AM +0200, Wolfram Sang wrote:
> On Sun, Apr 24, 2016 at 08:28:06PM +0100, Srinivas Kandagatla wrote:
> > This patch moves to nvmem support in the driver to use callback instead
> > of regmap.
> > 
> > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> Andrew, since you did the NVMEM implementation, could you have a look at
> this? That would be awesome. Thanks!
> 
> > ---
> >  drivers/misc/eeprom/Kconfig |   1 -
> >  drivers/misc/eeprom/at24.c  | 103 ++++++++++----------------------------------
> >  2 files changed, 22 insertions(+), 82 deletions(-)
> > 
> > diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig
> > index cfc493c..2d70464 100644
> > --- a/drivers/misc/eeprom/Kconfig
> > +++ b/drivers/misc/eeprom/Kconfig
> > @@ -3,7 +3,6 @@ menu "EEPROM support"
> >  config EEPROM_AT24
> >  	tristate "I2C EEPROMs / RAMs / ROMs from most vendors"
> >  	depends on I2C && SYSFS
> > -	select REGMAP
> >  	select NVMEM
> >  	help
> >  	  Enable this driver to get read/write support to most I2C EEPROMs
> > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> > index 089d694..de550a6 100644
> > --- a/drivers/misc/eeprom/at24.c
> > +++ b/drivers/misc/eeprom/at24.c
> > @@ -23,7 +23,6 @@
> >  #include <linux/acpi.h>
> >  #include <linux/i2c.h>
> >  #include <linux/nvmem-provider.h>
> > -#include <linux/regmap.h>
> >  #include <linux/platform_data/at24.h>
> >  
> >  /*
> > @@ -69,7 +68,6 @@ struct at24_data {
> >  	unsigned write_max;
> >  	unsigned num_addresses;
> >  
> > -	struct regmap_config regmap_config;
> >  	struct nvmem_config nvmem_config;
> >  	struct nvmem_device *nvmem;
> >  
> > @@ -252,10 +250,10 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf,
> >  	return -ETIMEDOUT;
> >  }
> >  
> > -static ssize_t at24_read(struct at24_data *at24,
> > -		char *buf, loff_t off, size_t count)
> > +static int at24_read(void *priv, unsigned int off, void *val, size_t count)
> >  {
> > -	ssize_t retval = 0;
> > +	struct at24_data *at24 = priv;
> > +	char *buf = val;
> >  
> >  	if (unlikely(!count))
> >  		return count;
> > @@ -267,23 +265,21 @@ static ssize_t at24_read(struct at24_data *at24,
> >  	mutex_lock(&at24->lock);
> >  
> >  	while (count) {
> > -		ssize_t	status;
> > +		int	status;
> >  
> >  		status = at24_eeprom_read(at24, buf, off, count);

Since the patch replaces ssize_t with int here, it would also make
sense to do the same to at24_eeprom_read and at24_eeprom_write. Either
use ssize_t everywhere or nowhere.

      Andrew

WARNING: multiple messages have this Message-ID (diff)
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/12] eeprom: at24: remove nvmem regmap dependency
Date: Wed, 4 May 2016 03:32:12 +0200	[thread overview]
Message-ID: <20160504013212.GA7972@lunn.ch> (raw)
In-Reply-To: <20160502073254.GA2015@tetsubishi>

On Mon, May 02, 2016 at 09:32:54AM +0200, Wolfram Sang wrote:
> On Sun, Apr 24, 2016 at 08:28:06PM +0100, Srinivas Kandagatla wrote:
> > This patch moves to nvmem support in the driver to use callback instead
> > of regmap.
> > 
> > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> Andrew, since you did the NVMEM implementation, could you have a look at
> this? That would be awesome. Thanks!
> 
> > ---
> >  drivers/misc/eeprom/Kconfig |   1 -
> >  drivers/misc/eeprom/at24.c  | 103 ++++++++++----------------------------------
> >  2 files changed, 22 insertions(+), 82 deletions(-)
> > 
> > diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig
> > index cfc493c..2d70464 100644
> > --- a/drivers/misc/eeprom/Kconfig
> > +++ b/drivers/misc/eeprom/Kconfig
> > @@ -3,7 +3,6 @@ menu "EEPROM support"
> >  config EEPROM_AT24
> >  	tristate "I2C EEPROMs / RAMs / ROMs from most vendors"
> >  	depends on I2C && SYSFS
> > -	select REGMAP
> >  	select NVMEM
> >  	help
> >  	  Enable this driver to get read/write support to most I2C EEPROMs
> > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> > index 089d694..de550a6 100644
> > --- a/drivers/misc/eeprom/at24.c
> > +++ b/drivers/misc/eeprom/at24.c
> > @@ -23,7 +23,6 @@
> >  #include <linux/acpi.h>
> >  #include <linux/i2c.h>
> >  #include <linux/nvmem-provider.h>
> > -#include <linux/regmap.h>
> >  #include <linux/platform_data/at24.h>
> >  
> >  /*
> > @@ -69,7 +68,6 @@ struct at24_data {
> >  	unsigned write_max;
> >  	unsigned num_addresses;
> >  
> > -	struct regmap_config regmap_config;
> >  	struct nvmem_config nvmem_config;
> >  	struct nvmem_device *nvmem;
> >  
> > @@ -252,10 +250,10 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf,
> >  	return -ETIMEDOUT;
> >  }
> >  
> > -static ssize_t at24_read(struct at24_data *at24,
> > -		char *buf, loff_t off, size_t count)
> > +static int at24_read(void *priv, unsigned int off, void *val, size_t count)
> >  {
> > -	ssize_t retval = 0;
> > +	struct at24_data *at24 = priv;
> > +	char *buf = val;
> >  
> >  	if (unlikely(!count))
> >  		return count;
> > @@ -267,23 +265,21 @@ static ssize_t at24_read(struct at24_data *at24,
> >  	mutex_lock(&at24->lock);
> >  
> >  	while (count) {
> > -		ssize_t	status;
> > +		int	status;
> >  
> >  		status = at24_eeprom_read(at24, buf, off, count);

Since the patch replaces ssize_t with int here, it would also make
sense to do the same to at24_eeprom_read and at24_eeprom_write. Either
use ssize_t everywhere or nowhere.

      Andrew

  reply	other threads:[~2016-05-04  1:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24 19:28 [PATCH 00/12] nvmem: remove regmap dependency Srinivas Kandagatla
2016-04-24 19:28 ` Srinivas Kandagatla
2016-04-24 19:28 ` [PATCH 01/12] nvmem: core: " Srinivas Kandagatla
2016-04-24 19:28   ` Srinivas Kandagatla
2016-04-24 19:28 ` [PATCH 02/12] eeprom: at24: remove nvmem " Srinivas Kandagatla
2016-04-24 19:28   ` Srinivas Kandagatla
2016-05-02  7:32   ` Wolfram Sang
2016-05-02  7:32     ` Wolfram Sang
2016-05-02  7:32     ` Wolfram Sang
2016-05-04  1:32     ` Andrew Lunn [this message]
2016-05-04  1:32       ` Andrew Lunn
     [not found] ` <1461526096-29584-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-04-24 19:28   ` [PATCH 03/12] eeprom: at25: " Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28   ` [PATCH 04/12] nvmem: qfprom: " Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28   ` [PATCH 05/12] nvmem: vif610-ocotp: " Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-27  5:36     ` maitysanchayan
2016-04-27  5:36       ` maitysanchayan at gmail.com
2016-04-24 19:28   ` [PATCH 06/12] nvmem: sunxi-sid: " Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28   ` [PATCH 07/12] nvmem: rockchip-efuse: " Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28   ` [PATCH 08/12] nvmem: mtk-efuse: " Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-24 19:28     ` Srinivas Kandagatla
2016-04-27  6:30     ` andrew-ct chen
2016-04-27  6:30       ` andrew-ct chen
2016-04-27  6:30       ` andrew-ct chen
2016-05-01 21:01     ` Greg Kroah-Hartman
2016-05-01 21:01       ` Greg Kroah-Hartman
2016-04-24 19:28 ` [PATCH 09/12] nvmem: imx-ocotp: " Srinivas Kandagatla
2016-04-24 19:28   ` Srinivas Kandagatla
2016-04-24 19:28 ` [PATCH 10/12] nvmem: lpc18xx-eeprom: " Srinivas Kandagatla
2016-04-24 19:28   ` Srinivas Kandagatla
2016-04-24 19:28 ` [PATCH 11/12] nvmem: mxs-ocotp: " Srinivas Kandagatla
2016-04-24 19:28   ` Srinivas Kandagatla
     [not found]   ` <1461526096-29584-12-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-04-28  6:50     ` Stefan Wahren
2016-04-28  6:50       ` Stefan Wahren
2016-04-28  6:50       ` Stefan Wahren
2016-04-24 19:28 ` [PATCH 12/12] nvmem: 93xx46: " Srinivas Kandagatla
2016-04-24 19:28   ` 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=20160504013212.GA7972@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=manabian@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=wens@csie.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.