Re: [PATCH 3/7] i2c: i2c-ocores: move header to platform_data

2018-04-20 Thread Lee Jones
On Thu, 19 Apr 2018, Wolfram Sang wrote:

> This header only contains platform_data. Move it to the proper directory.
> 
> Signed-off-by: Wolfram Sang <w...@the-dreams.de>
> ---
>  Documentation/i2c/busses/i2c-ocores| 2 +-
>  drivers/i2c/busses/i2c-ocores.c| 2 +-
>  drivers/mfd/timberdale.c   | 2 +-
>  include/linux/{ => platform_data}/i2c-ocores.h | 0
>  4 files changed, 3 insertions(+), 3 deletions(-)
>  rename include/linux/{ => platform_data}/i2c-ocores.h (100%)

Acked-by: Lee Jones <lee.jo...@linaro.org>

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/12] PM / mfd: intel-lpss: Use DPM_FLAG_SMART_SUSPEND

2017-11-08 Thread Lee Jones
On Wed, 01 Nov 2017, Rafael J. Wysocki wrote:

> On Wed, Nov 1, 2017 at 10:28 AM, Lee Jones <lee.jo...@linaro.org> wrote:
> > On Tue, 31 Oct 2017, Rafael J. Wysocki wrote:
> >
> >> On Tue, Oct 31, 2017 at 4:09 PM, Lee Jones <lee.jo...@linaro.org> wrote:
> >> > On Mon, 16 Oct 2017, Rafael J. Wysocki wrote:
> >> >
> >> >> From: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
> >> >>
> >> >> Make the intel-lpss driver set DPM_FLAG_SMART_SUSPEND for its
> >> >> devices which will allow them to stay in runtime suspend during
> >> >> system suspend unless they need to be reconfigured for some reason.
> >> >>
> >> >> Also make it avoid resuming its child devices if they have
> >> >> DPM_FLAG_SMART_SUSPEND set to allow them to remain in runtime
> >> >> suspend during system suspend.
> >> >>
> >> >> Signed-off-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
> >> >> ---
> >> >>  drivers/mfd/intel-lpss.c |6 +-
> >> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >> >
> >> > Is this patch independent?
> >>
> >> It depends on the flag definition at least, but functionally it also
> >> depends on the PCI support for the flag.
> >
> > No problem.  Which tree to you propose this goes through?
> 
> linux-pm.git if that's not a problem as the patches it depends on will
> go through it too.
> 
> That said I'll resend it when the core patches it depends on are ready.

It's fine by me.

Please check to see if there are any clashes with MFD.  If there are,
I'll need a (small) pull-request from you.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/12] PM / mfd: intel-lpss: Use DPM_FLAG_SMART_SUSPEND

2017-11-01 Thread Lee Jones
On Tue, 31 Oct 2017, Rafael J. Wysocki wrote:

> On Tue, Oct 31, 2017 at 4:09 PM, Lee Jones <lee.jo...@linaro.org> wrote:
> > On Mon, 16 Oct 2017, Rafael J. Wysocki wrote:
> >
> >> From: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
> >>
> >> Make the intel-lpss driver set DPM_FLAG_SMART_SUSPEND for its
> >> devices which will allow them to stay in runtime suspend during
> >> system suspend unless they need to be reconfigured for some reason.
> >>
> >> Also make it avoid resuming its child devices if they have
> >> DPM_FLAG_SMART_SUSPEND set to allow them to remain in runtime
> >> suspend during system suspend.
> >>
> >> Signed-off-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
> >> ---
> >>  drivers/mfd/intel-lpss.c |6 +-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > Is this patch independent?
> 
> It depends on the flag definition at least, but functionally it also
> depends on the PCI support for the flag.

No problem.  Which tree to you propose this goes through?

> > For my own reference:
> >   Acked-for-MFD-by: Lee Jones <lee.jo...@linaro.org>


-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/12] PM / mfd: intel-lpss: Use DPM_FLAG_SMART_SUSPEND

2017-10-31 Thread Lee Jones
On Mon, 16 Oct 2017, Rafael J. Wysocki wrote:

> From: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
> 
> Make the intel-lpss driver set DPM_FLAG_SMART_SUSPEND for its
> devices which will allow them to stay in runtime suspend during
> system suspend unless they need to be reconfigured for some reason.
> 
> Also make it avoid resuming its child devices if they have
> DPM_FLAG_SMART_SUSPEND set to allow them to remain in runtime
> suspend during system suspend.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
> ---
>  drivers/mfd/intel-lpss.c |6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Is this patch independent?

For my own reference:
  Acked-for-MFD-by: Lee Jones <lee.jo...@linaro.org>

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 101/102] Documentation: devres: add explicit exclusive/shared reset control request calls

2017-07-20 Thread Lee Jones
On Wed, 19 Jul 2017, Philipp Zabel wrote:

> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Add the explicit API calls to the devres list.
> 
> Cc: Jonathan Corbet <cor...@lwn.net>
> Cc: Lee Jones <lee.jo...@linaro.org>
> Cc: linux-doc@vger.kernel.org
> Signed-off-by: Philipp Zabel <p.za...@pengutronix.de>
> ---
>  Documentation/driver-model/devres.txt | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Acked-by: Lee Jones <lee.jo...@linaro.org>

> diff --git a/Documentation/driver-model/devres.txt 
> b/Documentation/driver-model/devres.txt
> index 30e04f7a690dd..fd157078dd558 100644
> --- a/Documentation/driver-model/devres.txt
> +++ b/Documentation/driver-model/devres.txt
> @@ -379,7 +379,12 @@ REGULATOR
>devm_regulator_register()
>  
>  RESET
> -  devm_reset_control_get()
> +  devm_reset_control_get_exclusive()
> +  devm_reset_control_get_shared()
> +  devm_reset_control_get_optional_exclusive()
> +  devm_reset_control_get_optional_shared()
> +  devm_reset_control_get_exclusive_by_index()
> +  devm_reset_control_get_shared_by_index()
>devm_reset_controller_register()
>  
>  SLAVE DMA ENGINE

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 03/46] backlight: lm3630a_bl: stop messing with the pwm->period field

2016-04-13 Thread Lee Jones
On Tue, 12 Apr 2016, Thierry Reding wrote:

> On Tue, Apr 12, 2016 at 03:16:13PM +0100, Lee Jones wrote:
> > On Tue, 12 Apr 2016, Thierry Reding wrote:
> > 
> > > On Wed, Mar 30, 2016 at 10:03:26PM +0200, Boris Brezillon wrote:
> > > > pwm->period field is not supposed to be changed by PWM users. The only
> > > > ones authorized to change it are the PWM core and PWM drivers.
> > > > 
> > > > Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
> > > > ---
> > > >  drivers/video/backlight/lm3630a_bl.c | 3 +--
> > > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > Applied, thanks.
> > 
> > Applied?
> 
> You didn't specifically Ack this one, but I presumed that since the
> change is essentially the same as for pwm-backlight, and this is another
> prerequisite for the remainder of the series it should go in through the
> PWM tree as well.

If you're taking Backlight patches through a !Backlight tree, you're
going to have to send out a pull-request.  There are no conflicts
currently, so I won't use it right away, but I need it in my arsenal
if they do occur.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 03/46] backlight: lm3630a_bl: stop messing with the pwm->period field

2016-04-12 Thread Lee Jones
On Tue, 12 Apr 2016, Thierry Reding wrote:

> On Wed, Mar 30, 2016 at 10:03:26PM +0200, Boris Brezillon wrote:
> > pwm->period field is not supposed to be changed by PWM users. The only
> > ones authorized to change it are the PWM core and PWM drivers.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
> > ---
> >  drivers/video/backlight/lm3630a_bl.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> Applied, thanks.

Applied?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 02/46] backlight: pwm_bl: remove useless call to pwm_set_period()

2016-04-12 Thread Lee Jones
On Tue, 12 Apr 2016, Thierry Reding wrote:

> On Wed, Mar 30, 2016 at 10:03:25PM +0200, Boris Brezillon wrote:
> > The PWM period will be set when calling pwm_config. Remove this useless
> > call to pwm_set_period(), which might mess up with the internal PWM state.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
> > Acked-by: Lee Jones <lee.jo...@linaro.org>
> > ---
> >  drivers/video/backlight/pwm_bl.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> Applied, thanks.

Applied?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 19/20] mfd: tps65910: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and remove
> the call of mfd_remove_devices() from .remove callback to remove
> MFD child-devices. This is done by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Tony Lindgren <t...@atomide.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> 
>  drivers/mfd/tps65910.c | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> index f7ab115..8086e5d 100644
> --- a/drivers/mfd/tps65910.c
> +++ b/drivers/mfd/tps65910.c
> @@ -510,10 +510,10 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
>   pm_power_off = tps65910_power_off;
>   }
>  
> - ret = mfd_add_devices(tps65910->dev, -1,
> -   tps65910s, ARRAY_SIZE(tps65910s),
> -   NULL, 0,
> -   regmap_irq_get_domain(tps65910->irq_data));
> + ret = devm_mfd_add_devices(tps65910->dev, -1,
> +tps65910s, ARRAY_SIZE(tps65910s),
> +NULL, 0,
> +regmap_irq_get_domain(tps65910->irq_data));
>   if (ret < 0) {
>   dev_err(>dev, "mfd_add_devices failed: %d\n", ret);
>   tps65910_irq_exit(tps65910);
> @@ -528,7 +528,6 @@ static int tps65910_i2c_remove(struct i2c_client *i2c)
>   struct tps65910 *tps65910 = i2c_get_clientdata(i2c);
>  
>   tps65910_irq_exit(tps65910);
> - mfd_remove_devices(tps65910->dev);
>  
>   return 0;
>  }

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 13/20] mfd: rn5t618: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and remove
> the call of mfd_remove_devices() from .remove callback to remove
> MFD child-devices. This is done by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Beniamino Galvani <b.galv...@gmail.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/rn5t618.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/rn5t618.c b/drivers/mfd/rn5t618.c
> index 6668571..0ad51d7 100644
> --- a/drivers/mfd/rn5t618.c
> +++ b/drivers/mfd/rn5t618.c
> @@ -78,8 +78,8 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c,
>   return ret;
>   }
>  
> - ret = mfd_add_devices(>dev, -1, rn5t618_cells,
> -   ARRAY_SIZE(rn5t618_cells), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(>dev, -1, rn5t618_cells,
> +ARRAY_SIZE(rn5t618_cells), NULL, 0, NULL);
>   if (ret) {
>   dev_err(>dev, "failed to add sub-devices: %d\n", ret);
>   return ret;
> @@ -102,7 +102,6 @@ static int rn5t618_i2c_remove(struct i2c_client *i2c)
>   pm_power_off = NULL;
>   }
>  
> - mfd_remove_devices(>dev);
>   return 0;
>  }
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 20/20] mfd: wm8400: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Mark Brown <broo...@kernel.org>
> CC: patc...@opensource.wolfsonmicro.com
> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Collected acks.
> 
>  drivers/mfd/wm8400-core.c | 25 +++--
>  1 file changed, 3 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
> index 3bd44a4..9fd8230 100644
> --- a/drivers/mfd/wm8400-core.c
> +++ b/drivers/mfd/wm8400-core.c
> @@ -70,7 +70,7 @@ static int wm8400_register_codec(struct wm8400 *wm8400)
>   .pdata_size = sizeof(*wm8400),
>   };
>  
> - return mfd_add_devices(wm8400->dev, -1, , 1, NULL, 0, NULL);
> + return devm_mfd_add_devices(wm8400->dev, -1, , 1, NULL, 0, NULL);
>  }
>  
>  /*
> @@ -111,7 +111,7 @@ static int wm8400_init(struct wm8400 *wm8400,
>   ret = wm8400_register_codec(wm8400);
>   if (ret != 0) {
>   dev_err(wm8400->dev, "Failed to register codec\n");
> - goto err_children;
> + return ret;
>   }
>  
>   if (pdata && pdata->platform_init) {
> @@ -119,21 +119,12 @@ static int wm8400_init(struct wm8400 *wm8400,
>   if (ret != 0) {
>   dev_err(wm8400->dev, "Platform init failed: %d\n",
>   ret);
> - goto err_children;
> + return ret;
>   }
>   } else
>   dev_warn(wm8400->dev, "No platform initialisation supplied\n");
>  
>   return 0;
> -
> -err_children:
> - mfd_remove_devices(wm8400->dev);
> - return ret;
> -}
> -
> -static void wm8400_release(struct wm8400 *wm8400)
> -{
> - mfd_remove_devices(wm8400->dev);
>  }
>  
>  static const struct regmap_config wm8400_regmap_config = {
> @@ -176,15 +167,6 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
>   return wm8400_init(wm8400, dev_get_platdata(>dev));
>  }
>  
> -static int wm8400_i2c_remove(struct i2c_client *i2c)
> -{
> - struct wm8400 *wm8400 = i2c_get_clientdata(i2c);
> -
> - wm8400_release(wm8400);
> -
> - return 0;
> -}
> -
>  static const struct i2c_device_id wm8400_i2c_id[] = {
> { "wm8400", 0 },
> { }
> @@ -196,7 +178,6 @@ static struct i2c_driver wm8400_i2c_driver = {
>   .name = "WM8400",
>   },
>   .probe= wm8400_i2c_probe,
> - .remove   = wm8400_i2c_remove,
>   .id_table = wm8400_i2c_id,
>  };
>  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 12/20] mfd: rk808: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and remove
> the call of mfd_remove_devices() from .remove callback to remove
> MFD child-devices. This is done by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Chris Zhong <z...@rock-chips.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/rk808.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
> index 4b1e439..49d7f62 100644
> --- a/drivers/mfd/rk808.c
> +++ b/drivers/mfd/rk808.c
> @@ -213,9 +213,9 @@ static int rk808_probe(struct i2c_client *client,
>   rk808->i2c = client;
>   i2c_set_clientdata(client, rk808);
>  
> - ret = mfd_add_devices(>dev, -1,
> -   rk808s, ARRAY_SIZE(rk808s),
> -   NULL, 0, regmap_irq_get_domain(rk808->irq_data));
> + ret = devm_mfd_add_devices(>dev, -1,
> +rk808s, ARRAY_SIZE(rk808s), NULL, 0,
> +regmap_irq_get_domain(rk808->irq_data));
>   if (ret) {
>   dev_err(>dev, "failed to add MFD devices %d\n", ret);
>   goto err_irq;
> @@ -240,7 +240,6 @@ static int rk808_remove(struct i2c_client *client)
>   struct rk808 *rk808 = i2c_get_clientdata(client);
>  
>       regmap_del_irq_chip(client->irq, rk808->irq_data);
> - mfd_remove_devices(>dev);
>   pm_power_off = NULL;
>  
>   return 0;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 15/20] mfd: sky81452: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Gyungoh Yoo <jack@skyworksinc.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/sky81452.c | 10 ++
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c
> index b0c9b04..30a2a67 100644
> --- a/drivers/mfd/sky81452.c
> +++ b/drivers/mfd/sky81452.c
> @@ -64,19 +64,14 @@ static int sky81452_probe(struct i2c_client *client,
>   cells[1].platform_data = pdata->regulator_init_data;
>   cells[1].pdata_size = sizeof(*pdata->regulator_init_data);
>  
> - ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells),
> +NULL, 0, NULL);
>   if (ret)
>   dev_err(dev, "failed to add child devices. err=%d\n", ret);
>  
>   return ret;
>  }
>  
> -static int sky81452_remove(struct i2c_client *client)
> -{
> - mfd_remove_devices(>dev);
> - return 0;
> -}
> -
>  static const struct i2c_device_id sky81452_ids[] = {
>   { "sky81452" },
>   { }
> @@ -97,7 +92,6 @@ static struct i2c_driver sky81452_driver = {
>   .of_match_table = of_match_ptr(sky81452_of_match),
>   },
>   .probe = sky81452_probe,
> - .remove = sky81452_remove,
>   .id_table = sky81452_ids,
>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 10/20] mfd: mt6397: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: John Crispin <blo...@openwrt.org>
> CC: Javier Martinez Canillas <jav...@osg.samsung.com>
> Reviewed-by: Javier Martinez Canillas <jav...@osg.samsung.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Collected reviewed by.
> 
>  drivers/mfd/mt6397-core.c | 18 ++
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> index 8e8d932..5a3ffa3 100644
> --- a/drivers/mfd/mt6397-core.c
> +++ b/drivers/mfd/mt6397-core.c
> @@ -276,8 +276,9 @@ static int mt6397_probe(struct platform_device *pdev)
>   pmic->int_con[1] = MT6323_INT_CON1;
>   pmic->int_status[0] = MT6323_INT_STATUS0;
>   pmic->int_status[1] = MT6323_INT_STATUS1;
> - ret = mfd_add_devices(>dev, -1, mt6323_devs,
> - ARRAY_SIZE(mt6323_devs), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(>dev, -1, mt6323_devs,
> +ARRAY_SIZE(mt6323_devs), NULL,
> +0, NULL);
>   break;
>  
>   case MT6397_CID_CODE:
> @@ -286,8 +287,9 @@ static int mt6397_probe(struct platform_device *pdev)
>   pmic->int_con[1] = MT6397_INT_CON1;
>   pmic->int_status[0] = MT6397_INT_STATUS0;
>   pmic->int_status[1] = MT6397_INT_STATUS1;
> - ret = mfd_add_devices(>dev, -1, mt6397_devs,
> - ARRAY_SIZE(mt6397_devs), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(>dev, -1, mt6397_devs,
> +ARRAY_SIZE(mt6397_devs), NULL,
> +0, NULL);
>   break;
>  
>   default:
> @@ -312,13 +314,6 @@ fail_irq:
>   return ret;
>  }
>  
> -static int mt6397_remove(struct platform_device *pdev)
> -{
> - mfd_remove_devices(>dev);
> -
> - return 0;
> -}
> -
>  static const struct of_device_id mt6397_of_match[] = {
>   { .compatible = "mediatek,mt6397" },
>   { .compatible = "mediatek,mt6323" },
> @@ -334,7 +329,6 @@ MODULE_DEVICE_TABLE(platform, mt6397_id);
>  
>  static struct platform_driver mt6397_driver = {
>   .probe = mt6397_probe,
> - .remove = mt6397_remove,
>   .driver = {
>   .name = "mt6397",
>   .of_match_table = of_match_ptr(mt6397_of_match),

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 18/20] mfd: tps65217: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Tony Lindgren <t...@atomide.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/tps65217.c | 14 ++
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index d32b5442..049a6fc 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -205,8 +205,8 @@ static int tps65217_probe(struct i2c_client *client,
>   return ret;
>   }
>  
> - ret = mfd_add_devices(tps->dev, -1, tps65217s,
> -   ARRAY_SIZE(tps65217s), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(tps->dev, -1, tps65217s,
> +ARRAY_SIZE(tps65217s), NULL, 0, NULL);
>   if (ret < 0) {
>   dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret);
>   return ret;
> @@ -235,15 +235,6 @@ static int tps65217_probe(struct i2c_client *client,
>   return 0;
>  }
>  
> -static int tps65217_remove(struct i2c_client *client)
> -{
> - struct tps65217 *tps = i2c_get_clientdata(client);
> -
> - mfd_remove_devices(tps->dev);
> -
> - return 0;
> -}
> -
>  static const struct i2c_device_id tps65217_id_table[] = {
>   {"tps65217", TPS65217},
>   { /* sentinel */ }
> @@ -257,7 +248,6 @@ static struct i2c_driver tps65217_driver = {
>   },
>   .id_table   = tps65217_id_table,
>   .probe  = tps65217_probe,
> - .remove = tps65217_remove,
>  };
>  
>  static int __init tps65217_init(void)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 17/20] mfd: tps6507x: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Todd Fischer <todd.fisc...@ridgerun.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Fix checkpatch --strict error on patch.
> 
>  drivers/mfd/tps6507x.c | 13 ++---
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mfd/tps6507x.c b/drivers/mfd/tps6507x.c
> index 1ab3dd6..40beb2f 100644
> --- a/drivers/mfd/tps6507x.c
> +++ b/drivers/mfd/tps6507x.c
> @@ -100,16 +100,8 @@ static int tps6507x_i2c_probe(struct i2c_client *i2c,
>   tps6507x->read_dev = tps6507x_i2c_read_device;
>   tps6507x->write_dev = tps6507x_i2c_write_device;
>  
> - return mfd_add_devices(tps6507x->dev, -1, tps6507x_devs,
> -ARRAY_SIZE(tps6507x_devs), NULL, 0, NULL);
> -}
> -
> -static int tps6507x_i2c_remove(struct i2c_client *i2c)
> -{
> - struct tps6507x_dev *tps6507x = i2c_get_clientdata(i2c);
> -
> - mfd_remove_devices(tps6507x->dev);
> - return 0;
> + return devm_mfd_add_devices(tps6507x->dev, -1, tps6507x_devs,
> + ARRAY_SIZE(tps6507x_devs), NULL, 0, NULL);
>  }
>  
>  static const struct i2c_device_id tps6507x_i2c_id[] = {
> @@ -132,7 +124,6 @@ static struct i2c_driver tps6507x_i2c_driver = {
>  .of_match_table = of_match_ptr(tps6507x_of_match),
>   },
>   .probe = tps6507x_i2c_probe,
> - .remove = tps6507x_i2c_remove,
>   .id_table = tps6507x_i2c_id,
>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 06/20] mfd: bcm590xx: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Matt Porter <mpor...@linaro.org>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/bcm590xx.c | 11 ++-
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c
> index 320aaef..0d76d69 100644
> --- a/drivers/mfd/bcm590xx.c
> +++ b/drivers/mfd/bcm590xx.c
> @@ -82,8 +82,8 @@ static int bcm590xx_i2c_probe(struct i2c_client *i2c_pri,
>   goto err;
>   }
>  
> - ret = mfd_add_devices(_pri->dev, -1, bcm590xx_devs,
> -   ARRAY_SIZE(bcm590xx_devs), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(_pri->dev, -1, bcm590xx_devs,
> +ARRAY_SIZE(bcm590xx_devs), NULL, 0, NULL);
>   if (ret < 0) {
>   dev_err(_pri->dev, "failed to add sub-devices: %d\n", ret);
>   goto err;
> @@ -96,12 +96,6 @@ err:
>   return ret;
>  }
>  
> -static int bcm590xx_i2c_remove(struct i2c_client *i2c)
> -{
> - mfd_remove_devices(>dev);
> - return 0;
> -}
> -
>  static const struct of_device_id bcm590xx_of_match[] = {
>   { .compatible = "brcm,bcm59056" },
>   { }
> @@ -120,7 +114,6 @@ static struct i2c_driver bcm590xx_i2c_driver = {
>  .of_match_table = of_match_ptr(bcm590xx_of_match),
>   },
>   .probe = bcm590xx_i2c_probe,
> - .remove = bcm590xx_i2c_remove,
>   .id_table = bcm590xx_i2c_id,
>  };
>  module_i2c_driver(bcm590xx_i2c_driver);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 09/20] mfd: menf21bmc: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Andreas Werner <andreas.wer...@men.de>
> Reviewed-by: Andreas Werner <andreas.wer...@men.de>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> - Collected reviewed by.
> 
>  drivers/mfd/menf21bmc.c | 11 ++-
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mfd/menf21bmc.c b/drivers/mfd/menf21bmc.c
> index 1c27434..3ad2def 100644
> --- a/drivers/mfd/menf21bmc.c
> +++ b/drivers/mfd/menf21bmc.c
> @@ -96,8 +96,8 @@ menf21bmc_probe(struct i2c_client *client, const struct 
> i2c_device_id *ids)
>   return ret;
>   }
>  
> - ret = mfd_add_devices(>dev, 0, menf21bmc_cell,
> -   ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(>dev, 0, menf21bmc_cell,
> +ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL);
>   if (ret < 0) {
>   dev_err(>dev, "failed to add BMC sub-devices\n");
>   return ret;
> @@ -106,12 +106,6 @@ menf21bmc_probe(struct i2c_client *client, const struct 
> i2c_device_id *ids)
>   return 0;
>  }
>  
> -static int menf21bmc_remove(struct i2c_client *client)
> -{
> - mfd_remove_devices(>dev);
> - return 0;
> -}
> -
>  static const struct i2c_device_id menf21bmc_id_table[] = {
>   { "menf21bmc" },
>   { }
> @@ -122,7 +116,6 @@ static struct i2c_driver menf21bmc_driver = {
>   .driver.name= "menf21bmc",
>   .id_table   = menf21bmc_id_table,
>   .probe  = menf21bmc_probe,
> - .remove = menf21bmc_remove,
>  };
>  
>  module_i2c_driver(menf21bmc_driver);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 04/20] mfd: as3711: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Guennadi Liakhovetski <g.liakhovet...@gmx.de>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/as3711.c | 13 ++---
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
> index 09e1483..67b1241 100644
> --- a/drivers/mfd/as3711.c
> +++ b/drivers/mfd/as3711.c
> @@ -189,22 +189,14 @@ static int as3711_i2c_probe(struct i2c_client *client,
>   as3711_subdevs[AS3711_BACKLIGHT].pdata_size = 0;
>   }
>  
> - ret = mfd_add_devices(as3711->dev, -1, as3711_subdevs,
> -   ARRAY_SIZE(as3711_subdevs), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(as3711->dev, -1, as3711_subdevs,
> +ARRAY_SIZE(as3711_subdevs), NULL, 0, NULL);
>   if (ret < 0)
>   dev_err(>dev, "add mfd devices failed: %d\n", ret);
>  
>   return ret;
>  }
>  
> -static int as3711_i2c_remove(struct i2c_client *client)
> -{
> - struct as3711 *as3711 = i2c_get_clientdata(client);
> -
> - mfd_remove_devices(as3711->dev);
> - return 0;
> -}
> -
>  static const struct i2c_device_id as3711_i2c_id[] = {
>   {.name = "as3711", .driver_data = 0},
>   {}
> @@ -218,7 +210,6 @@ static struct i2c_driver as3711_i2c_driver = {
>      .of_match_table = of_match_ptr(as3711_of_match),
>   },
>   .probe = as3711_i2c_probe,
> - .remove = as3711_i2c_remove,
>   .id_table = as3711_i2c_id,
>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 02/20] mfd: Add devm_mfd_add_devices() in list of managed interfaces

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Add devm wrappers for the mfd_add_devices() in the list of managed
> interfaces.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> 
> ---
> Changes from V1:
> - Reformat the commit message.
> - Remove devm_ for mfd_remove_devices() as this is not used.
> 
>  Documentation/driver-model/devres.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/driver-model/devres.txt 
> b/Documentation/driver-model/devres.txt
> index 73b98df..7f8c416 100644
> --- a/Documentation/driver-model/devres.txt
> +++ b/Documentation/driver-model/devres.txt
> @@ -317,6 +317,9 @@ MEM
>devm_kvasprintf()
>devm_kzalloc()
>  
> +MFD
> + devm_mfd_add_devices()
> +
>  PCI
>pcim_enable_device()   : after success, all PCI ops become managed
>pcim_pin_device()  : keep PCI device enabled after release

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 05/20] mfd: atmel-hlcdc: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Boris Brezillon <boris.brezil...@free-electrons.com>
> Acked-by: Boris Brezillon <boris.brezil...@free-electrons.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> - Collected acks.
> 
>  drivers/mfd/atmel-hlcdc.c | 14 +++---
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
> index 06c2058..eca7ea6 100644
> --- a/drivers/mfd/atmel-hlcdc.c
> +++ b/drivers/mfd/atmel-hlcdc.c
> @@ -128,16 +128,9 @@ static int atmel_hlcdc_probe(struct platform_device 
> *pdev)
>  
>   dev_set_drvdata(dev, hlcdc);
>  
> - return mfd_add_devices(dev, -1, atmel_hlcdc_cells,
> -ARRAY_SIZE(atmel_hlcdc_cells),
> -NULL, 0, NULL);
> -}
> -
> -static int atmel_hlcdc_remove(struct platform_device *pdev)
> -{
> - mfd_remove_devices(>dev);
> -
> - return 0;
> + return devm_mfd_add_devices(dev, -1, atmel_hlcdc_cells,
> + ARRAY_SIZE(atmel_hlcdc_cells),
> + NULL, 0, NULL);
>  }
>  
>  static const struct of_device_id atmel_hlcdc_match[] = {
> @@ -152,7 +145,6 @@ MODULE_DEVICE_TABLE(of, atmel_hlcdc_match);
>  
>  static struct platform_driver atmel_hlcdc_driver = {
>   .probe = atmel_hlcdc_probe,
> - .remove = atmel_hlcdc_remove,
>   .driver = {
>   .name = "atmel-hlcdc",
>   .of_match_table = atmel_hlcdc_match,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 08/20] mfd: lp3943: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Milo Kim <milo@ti.com>
> Acked-by: Milo Kim <milo@ti.com>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Collected acks.
> 
>  drivers/mfd/lp3943.c | 14 +++---
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mfd/lp3943.c b/drivers/mfd/lp3943.c
> index eecbb13..65a2a8f1 100644
> --- a/drivers/mfd/lp3943.c
> +++ b/drivers/mfd/lp3943.c
> @@ -123,16 +123,9 @@ static int lp3943_probe(struct i2c_client *cl, const 
> struct i2c_device_id *id)
>   lp3943->mux_cfg = lp3943_mux_cfg;
>   i2c_set_clientdata(cl, lp3943);
>  
> - return mfd_add_devices(dev, -1, lp3943_devs, ARRAY_SIZE(lp3943_devs),
> -NULL, 0, NULL);
> -}
> -
> -static int lp3943_remove(struct i2c_client *cl)
> -{
> - struct lp3943 *lp3943 = i2c_get_clientdata(cl);
> -
> - mfd_remove_devices(lp3943->dev);
> - return 0;
> + return devm_mfd_add_devices(dev, -1, lp3943_devs,
> + ARRAY_SIZE(lp3943_devs),
> + NULL, 0, NULL);
>  }
>  
>  static const struct i2c_device_id lp3943_ids[] = {
> @@ -151,7 +144,6 @@ MODULE_DEVICE_TABLE(of, lp3943_of_match);
>  
>  static struct i2c_driver lp3943_driver = {
>   .probe = lp3943_probe,
> - .remove = lp3943_remove,
>   .driver = {
>   .name = "lp3943",
>   .of_match_table = of_match_ptr(lp3943_of_match),

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 07/20] mfd: hi6421-pmic: Use devm_mfd_add_devices() for mfd_device registration

2016-04-11 Thread Lee Jones
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> Use devm_mfd_add_devices() for MFD devices registration and get
> rid of .remove callback to remove MFD child-devices. This is done
> by managed device framework.
> 
> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> CC: Guodong Xu <guodong...@linaro.org>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Run checkpatch with --strict option and fix warning.
> 
>  drivers/mfd/hi6421-pmic-core.c | 12 ++--
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mfd/hi6421-pmic-core.c b/drivers/mfd/hi6421-pmic-core.c
> index f9ded45..3fd703f 100644
> --- a/drivers/mfd/hi6421-pmic-core.c
> +++ b/drivers/mfd/hi6421-pmic-core.c
> @@ -76,8 +76,8 @@ static int hi6421_pmic_probe(struct platform_device *pdev)
>  
>   platform_set_drvdata(pdev, pmic);
>  
> - ret = mfd_add_devices(>dev, 0, hi6421_devs,
> - ARRAY_SIZE(hi6421_devs), NULL, 0, NULL);
> + ret = devm_mfd_add_devices(>dev, 0, hi6421_devs,
> +ARRAY_SIZE(hi6421_devs), NULL, 0, NULL);
>   if (ret) {
>   dev_err(>dev, "add mfd devices failed: %d\n", ret);
>   return ret;
> @@ -86,13 +86,6 @@ static int hi6421_pmic_probe(struct platform_device *pdev)
>   return 0;
>  }
>  
> -static int hi6421_pmic_remove(struct platform_device *pdev)
> -{
> - mfd_remove_devices(>dev);
> -
> - return 0;
> -}
> -
>  static const struct of_device_id of_hi6421_pmic_match_tbl[] = {
>   { .compatible = "hisilicon,hi6421-pmic", },
>   { },
> @@ -105,7 +98,6 @@ static struct platform_driver hi6421_pmic_driver = {
>   .of_match_table = of_hi6421_pmic_match_tbl,
>   },
>   .probe  = hi6421_pmic_probe,
> - .remove = hi6421_pmic_remove,
>  };
>  module_platform_driver(hi6421_pmic_driver);
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices

2016-04-07 Thread Lee Jones
On Tue, 05 Apr 2016, Laxman Dewangan wrote:

> Add device managed APIs devm_mfd_add_devices() and
> devm_mfd_remove_devices() for the APIs mfd_add_devices()
> and mfd_remove_devices().

Nit: Line wrap after "devm_mfd_remove_devices()" instead.

> This helps in reducing code in error path and sometimes
> removal of .remove callback for driver unbind.

s/for/during/

> Signed-off-by: Laxman Dewangan <ldewan...@nvidia.com>
> ---
>  drivers/mfd/mfd-core.c   | 62 
> 
>  include/linux/mfd/core.h |  7 ++
>  2 files changed, 69 insertions(+)
> 
> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> index 409da01..145712e 100644
> --- a/drivers/mfd/mfd-core.c
> +++ b/drivers/mfd/mfd-core.c
> @@ -334,6 +334,68 @@ void mfd_remove_devices(struct device *parent)
>  }
>  EXPORT_SYMBOL(mfd_remove_devices);
>  
> +static void devm_mfd_dev_release(struct device *dev, void *res)
> +{
> + mfd_remove_devices(dev);
> +}
> +
> +/**
> + * devm_mfd_add_devices - Resource managed version of mfd_add_devices()
> + *
> + * This returns the 0 on success otherwise error number in the failure.

"Returns 0 on success or an appropriate negative error number on failure."

> + * The allocated mfd devices will automatically be released when the

s/mfd/MFD/

> + * device is unbound.
> + */
> +int devm_mfd_add_devices(struct device *dev, int id,
> + const struct mfd_cell *cells, int n_devs,
> + struct resource *mem_base,
> + int irq_base, struct irq_domain *domain)
> +{
> + struct device **ptr;
> + int ret;
> +
> + ptr = devres_alloc(devm_mfd_dev_release, sizeof(*ptr), GFP_KERNEL);
> + if (!ptr)
> + return -ENOMEM;
> +
> + ret = mfd_add_devices(dev, id, cells, n_devs, mem_base,
> +   irq_base, domain);
> + if (!ret) {
> + *ptr = dev;
> + devres_add(dev, ptr);
> + } else {
> + devres_free(ptr);
> + }

Switch these round.  If you encounter a problem, free and return.  If
not, skip the error handling and add the device outside of the if().

> + return ret;
> +}
> +EXPORT_SYMBOL(devm_mfd_add_devices);
> +
> +static int devm_mfd_devs_match(struct device *dev, void *res, void *data)
> +{
> + struct device **r = res;
> +
> + if (WARN_ON(!r || !*r))
> + return 0;
> +
> + return *r == data;
> +}
> +
> +/**
> + * devm_mfd_remove_device - Resource managed version of mfd_remove_devices()
> + * @dev: Device for which which resource was allocated.

Did you proof read your own writing?  Pleaes re-word.

> + * Remove all mfd devices added on the device.

s/mfd/MFD/

'D' already means devices, so here you are saying "devices devices".
Please re-word.  Besides, you need to be more specific as to which
"devices on the devices" you are detailing, since this sentence
doesn't really make a great deal of sense.

> + * Normally this function will not need to be called and the resource
> + * management code will ensure that the resource is freed.

Then what is the purpose of providing it?  Do you have a user?

> + */
> +void devm_mfd_remove_devices(struct device *dev)
> +{
> + WARN_ON(devres_release(dev, devm_mfd_dev_release,
> +devm_mfd_devs_match, dev));
> +}
> +EXPORT_SYMBOL(devm_mfd_remove_devices);
> +
>  int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones)
>  {
>   struct mfd_cell cell_entry;
> diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
> index bc6f7e0..d658d7f 100644
> --- a/include/linux/mfd/core.h
> +++ b/include/linux/mfd/core.h
> @@ -131,4 +131,11 @@ static inline int mfd_add_hotplug_devices(struct device 
> *parent,
>  
>  extern void mfd_remove_devices(struct device *parent);
>  
> +extern int devm_mfd_add_devices(struct device *dev, int id,
> +const struct mfd_cell *cells, int n_devs,
> +struct resource *mem_base,
> +int irq_base, struct irq_domain *irq_domain);
> +
> +extern void devm_mfd_remove_devices(struct device *dev);
> +
>  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html