stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Johan Hovold <johan@kernel.org>
Cc: Support Opensource <support.opensource@diasemi.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Milo Kim <milo.kim@ti.com>,
	patches@opensource.wolfsonmicro.com,
	Fabio Estevam <fabio.estevam@freescale.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH 1/2] mfd: da9052: fix broken regulator probe
Date: Thu, 26 Mar 2015 08:32:09 +0000	[thread overview]
Message-ID: <20150326083209.GE5951@x1> (raw)
In-Reply-To: <1427281625-31241-1-git-send-email-johan@kernel.org>

On Wed, 25 Mar 2015, Johan Hovold wrote:

> Fix broken probe of da9052 regulators, which since commit b3f6c73db732
> ("mfd: da9052-core: Fix platform-device id collision") use a
> non-deterministic platform-device id to retrieve static regulator
> information. Fortunately, adequate error handling was in place so probe
> would simply fail with an error message.
> 
> Update the mfd-cell ids to be zero-based and use those to identify the
> cells when probing the regulator devices.
> 
> Fixes: b3f6c73db732 ("mfd: da9052-core: Fix platform-device id collision")
> Cc: stable <stable@vger.kernel.org>	# v3.19
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/mfd/da9052-core.c            | 8 ++++----
>  drivers/regulator/da9052-regulator.c | 5 +++--

Need an Ack from Mark, but looks good to me.

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

>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c
> index ae498b53ee40..46e3840c7a37 100644
> --- a/drivers/mfd/da9052-core.c
> +++ b/drivers/mfd/da9052-core.c
> @@ -433,6 +433,10 @@ EXPORT_SYMBOL_GPL(da9052_adc_read_temp);
>  static const struct mfd_cell da9052_subdev_info[] = {
>  	{
>  		.name = "da9052-regulator",
> +		.id = 0,
> +	},
> +	{
> +		.name = "da9052-regulator",
>  		.id = 1,
>  	},
>  	{
> @@ -484,10 +488,6 @@ static const struct mfd_cell da9052_subdev_info[] = {
>  		.id = 13,
>  	},
>  	{
> -		.name = "da9052-regulator",
> -		.id = 14,
> -	},
> -	{
>  		.name = "da9052-onkey",
>  	},
>  	{
> diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
> index 8a4df7a1f2ee..e628d4c2f2ae 100644
> --- a/drivers/regulator/da9052-regulator.c
> +++ b/drivers/regulator/da9052-regulator.c
> @@ -394,6 +394,7 @@ static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id,
>  
>  static int da9052_regulator_probe(struct platform_device *pdev)
>  {
> +	const struct mfd_cell *cell = mfd_get_cell(pdev);
>  	struct regulator_config config = { };
>  	struct da9052_regulator *regulator;
>  	struct da9052 *da9052;
> @@ -409,7 +410,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
>  	regulator->da9052 = da9052;
>  
>  	regulator->info = find_regulator_info(regulator->da9052->chip_id,
> -					      pdev->id);
> +					      cell->id);
>  	if (regulator->info == NULL) {
>  		dev_err(&pdev->dev, "invalid regulator ID specified\n");
>  		return -EINVAL;
> @@ -419,7 +420,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
>  	config.driver_data = regulator;
>  	config.regmap = da9052->regmap;
>  	if (pdata && pdata->regulators) {
> -		config.init_data = pdata->regulators[pdev->id];
> +		config.init_data = pdata->regulators[cell->id];
>  	} else {
>  #ifdef CONFIG_OF
>  		struct device_node *nproot = da9052->dev->of_node;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  parent reply	other threads:[~2015-03-26  8:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150325110231.GC10412@localhost>
2015-03-25 11:07 ` [PATCH 1/2] mfd: da9052: fix broken regulator probe Johan Hovold
2015-03-25 11:07   ` [PATCH 2/2] mfd: core: fix platform-device name collisions Johan Hovold
2015-03-25 12:02     ` Bartlomiej Zolnierkiewicz
2015-03-26  8:34     ` Lee Jones
2015-03-25 12:01   ` [PATCH 1/2] mfd: da9052: fix broken regulator probe Bartlomiej Zolnierkiewicz
2015-03-26  8:32   ` Lee Jones [this message]
2015-04-14 13:04     ` Johan Hovold
2015-04-29  7:44       ` Johan Hovold
2015-04-29  8:41         ` Lee Jones
2015-05-13 15:43           ` Lee Jones
2015-05-13 16:08             ` Mark Brown
2015-05-13 16:54               ` Lee Jones
2015-05-13 17:29                 ` Mark Brown
2015-05-14  7:19                   ` Lee Jones
2015-05-15 14:47                     ` Johan Hovold
2015-05-18  9:10                       ` Lee Jones
2015-05-18  9:51                         ` Johan Hovold
2015-05-18 10:13                           ` Lee Jones
2015-05-18 16:28                             ` Mark Brown
2015-05-18 16:24                           ` Mark Brown
2015-05-18 16:46                             ` Johan Hovold
2015-05-18 18:46                               ` Mark Brown
2015-05-19 10:01                                 ` Johan Hovold
2015-05-19 10:38                                   ` Mark Brown
2015-05-19 11:01                                     ` Johan Hovold
2015-05-19 12:01                                       ` Mark Brown
2015-05-15 14:27             ` [PATCH RESEND] " Johan Hovold
2015-05-18 18:47               ` Mark Brown
2015-05-18 18:57               ` Lee Jones
2015-03-30  7:18   ` [PATCH 1/2] " Lee Jones

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=20150326083209.GE5951@x1 \
    --to=lee.jones@linaro.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@freescale.com \
    --cc=johan@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=milo.kim@ti.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=sameo@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /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).