Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Markus Schneider-Pargmann <msp@baylibre.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Tony Lindgren <tony@atomide.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Jerome Neanne <jneanne@baylibre.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, khilman@baylibre.com, j-keerthy@ti.com
Subject: Re: [RESEND PATCH] regulator: tps65219: Fix matching interrupts for their regulators
Date: Mon, 8 May 2023 10:53:41 +0200	[thread overview]
Message-ID: <20230508085341.hggdfw45zqer4e5q@blmsp> (raw)
In-Reply-To: <20230507144656.192800-1-krzysztof.kozlowski@linaro.org>

Hi,

On Sun, May 07, 2023 at 04:46:56PM +0200, Krzysztof Kozlowski wrote:
> The driver's probe() first registers regulators in a loop and then in a
> second loop passes them as irq data to the interrupt handlers.  However
> the function to get the regulator for given name
> tps65219_get_rdev_by_name() was a no-op due to argument passed by value,
> not pointer, thus the second loop assigned always same value - from
> previous loop.  The interrupts, when fired, where executed with wrong
> data.  Compiler also noticed it:
> 
>   drivers/regulator/tps65219-regulator.c: In function ‘tps65219_get_rdev_by_name’:
>   drivers/regulator/tps65219-regulator.c:292:60: error: parameter ‘dev’ set but not used [-Werror=unused-but-set-parameter]
> 
> Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>

Best,
Markus

> 
> ---
> 
> Not tested.
> Sent two months ago and no comments, so resending.
> 
> Cc: Jerome Neanne <jneanne@baylibre.com>
> Cc: khilman@baylibre.com
> Cc: msp@baylibre.com
> Cc: j-keerthy@ti.com
> ---
>  drivers/regulator/tps65219-regulator.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c
> index b1719ee990ab..8971b507a79a 100644
> --- a/drivers/regulator/tps65219-regulator.c
> +++ b/drivers/regulator/tps65219-regulator.c
> @@ -289,13 +289,13 @@ static irqreturn_t tps65219_regulator_irq_handler(int irq, void *data)
>  
>  static int tps65219_get_rdev_by_name(const char *regulator_name,
>  				     struct regulator_dev *rdevtbl[7],
> -				     struct regulator_dev *dev)
> +				     struct regulator_dev **dev)
>  {
>  	int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(regulators); i++) {
>  		if (strcmp(regulator_name, regulators[i].name) == 0) {
> -			dev = rdevtbl[i];
> +			*dev = rdevtbl[i];
>  			return 0;
>  		}
>  	}
> @@ -348,7 +348,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
>  		irq_data[i].dev = tps->dev;
>  		irq_data[i].type = irq_type;
>  
> -		tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
> +		tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, &rdev);
>  		if (IS_ERR(rdev)) {
>  			dev_err(tps->dev, "Failed to get rdev for %s\n",
>  				irq_type->regulator_name);
> -- 
> 2.34.1
> 

  reply	other threads:[~2023-05-08  8:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07 14:46 [RESEND PATCH] regulator: tps65219: Fix matching interrupts for their regulators Krzysztof Kozlowski
2023-05-08  8:53 ` Markus Schneider-Pargmann [this message]
2023-05-09  6:39 ` Mark Brown

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=20230508085341.hggdfw45zqer4e5q@blmsp \
    --to=msp@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=jneanne@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tony@atomide.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