LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe
@ 2018-12-06 17:37 Keerthy
  2018-12-06 20:51 ` Sebastian Reichel
  0 siblings, 1 reply; 3+ messages in thread
From: Keerthy @ 2018-12-06 17:37 UTC (permalink / raw)
  To: tony, lee.jones; +Cc: t-kristo, j-keerthy, linux-omap, linux-kernel

Use devm_regmap_add_irq_chip and clean up error path in probe.

Reported-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
---

Boot tested on am437x-gp-evm.

 drivers/mfd/tps65218.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
index 910f569..2383621 100644
--- a/drivers/mfd/tps65218.c
+++ b/drivers/mfd/tps65218.c
@@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client,
 
 	mutex_init(&tps->tps_lock);
 
-	ret = regmap_add_irq_chip(tps->regmap, tps->irq,
-			IRQF_ONESHOT, 0, &tps65218_irq_chip,
-			&tps->irq_data);
+	ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq,
+				       IRQF_ONESHOT, 0, &tps65218_irq_chip,
+				       &tps->irq_data);
 	if (ret < 0)
 		return ret;
 
@@ -253,14 +253,6 @@ static int tps65218_probe(struct i2c_client *client,
 			      ARRAY_SIZE(tps65218_cells), NULL, 0,
 			      regmap_irq_get_domain(tps->irq_data));
 
-	if (ret < 0)
-		goto err_irq;
-
-	return 0;
-
-err_irq:
-	regmap_del_irq_chip(tps->irq, tps->irq_data);
-
 	return ret;
 }
 
-- 
1.9.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe
  2018-12-06 17:37 [PATCH] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Keerthy
@ 2018-12-06 20:51 ` Sebastian Reichel
  2018-12-07  0:22   ` J, KEERTHY
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Reichel @ 2018-12-06 20:51 UTC (permalink / raw)
  To: Keerthy; +Cc: tony, lee.jones, t-kristo, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Hi,

On Thu, Dec 06, 2018 at 11:07:44PM +0530, Keerthy wrote:
> Use devm_regmap_add_irq_chip and clean up error path in probe.
> 
> Reported-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> 
> Boot tested on am437x-gp-evm.

This is missing cleanup of remove path?

-- Sebastian

>  drivers/mfd/tps65218.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
> index 910f569..2383621 100644
> --- a/drivers/mfd/tps65218.c
> +++ b/drivers/mfd/tps65218.c
> @@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client,
>  
>  	mutex_init(&tps->tps_lock);
>  
> -	ret = regmap_add_irq_chip(tps->regmap, tps->irq,
> -			IRQF_ONESHOT, 0, &tps65218_irq_chip,
> -			&tps->irq_data);
> +	ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq,
> +				       IRQF_ONESHOT, 0, &tps65218_irq_chip,
> +				       &tps->irq_data);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -253,14 +253,6 @@ static int tps65218_probe(struct i2c_client *client,
>  			      ARRAY_SIZE(tps65218_cells), NULL, 0,
>  			      regmap_irq_get_domain(tps->irq_data));
>  
> -	if (ret < 0)
> -		goto err_irq;
> -
> -	return 0;
> -
> -err_irq:
> -	regmap_del_irq_chip(tps->irq, tps->irq_data);
> -
>  	return ret;
>  }
>  
> -- 
> 1.9.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe
  2018-12-06 20:51 ` Sebastian Reichel
@ 2018-12-07  0:22   ` J, KEERTHY
  0 siblings, 0 replies; 3+ messages in thread
From: J, KEERTHY @ 2018-12-07  0:22 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: tony, lee.jones, t-kristo, linux-omap, linux-kernel



On 12/7/2018 2:21 AM, Sebastian Reichel wrote:
> Hi,
> 
> On Thu, Dec 06, 2018 at 11:07:44PM +0530, Keerthy wrote:
>> Use devm_regmap_add_irq_chip and clean up error path in probe.
>>
>> Reported-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>
>> Boot tested on am437x-gp-evm.
> 
> This is missing cleanup of remove path?

Yes! Thanks for catching it. I will send v2 in a bit.

> 
> -- Sebastian
> 
>>   drivers/mfd/tps65218.c | 14 +++-----------
>>   1 file changed, 3 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
>> index 910f569..2383621 100644
>> --- a/drivers/mfd/tps65218.c
>> +++ b/drivers/mfd/tps65218.c
>> @@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client,
>>   
>>   	mutex_init(&tps->tps_lock);
>>   
>> -	ret = regmap_add_irq_chip(tps->regmap, tps->irq,
>> -			IRQF_ONESHOT, 0, &tps65218_irq_chip,
>> -			&tps->irq_data);
>> +	ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq,
>> +				       IRQF_ONESHOT, 0, &tps65218_irq_chip,
>> +				       &tps->irq_data);
>>   	if (ret < 0)
>>   		return ret;
>>   
>> @@ -253,14 +253,6 @@ static int tps65218_probe(struct i2c_client *client,
>>   			      ARRAY_SIZE(tps65218_cells), NULL, 0,
>>   			      regmap_irq_get_domain(tps->irq_data));
>>   
>> -	if (ret < 0)
>> -		goto err_irq;
>> -
>> -	return 0;
>> -
>> -err_irq:
>> -	regmap_del_irq_chip(tps->irq, tps->irq_data);
>> -
>>   	return ret;
>>   }
>>   
>> -- 
>> 1.9.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06 17:37 [PATCH] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Keerthy
2018-12-06 20:51 ` Sebastian Reichel
2018-12-07  0:22   ` J, KEERTHY

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox