linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up  error path in probe
@ 2018-12-09 13:59 Keerthy
  2018-12-09 22:45 ` Sebastian Reichel
  2018-12-14 12:41 ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Keerthy @ 2018-12-09 13:59 UTC (permalink / raw)
  To: tony, lee.jones
  Cc: linux-omap, linux-kernel, sebastian.reichel, t-kristo, j-keerthy, ladis

Use devm_regmap_add_irq_chip and clean up error path in probe
and also the remove function.

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

Changes in v2:

  * Cleaned up remove function as well.

Changes in v3:

  * Deleted the remove function which was just returning 0

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

diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
index 910f569..8bcdecf 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,26 +253,9 @@ 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;
 }
 
-static int tps65218_remove(struct i2c_client *client)
-{
-	struct tps65218 *tps = i2c_get_clientdata(client);
-
-	regmap_del_irq_chip(tps->irq, tps->irq_data);
-
-	return 0;
-}
-
 static const struct i2c_device_id tps65218_id_table[] = {
 	{ "tps65218", TPS65218 },
 	{ },
@@ -285,7 +268,6 @@ static int tps65218_remove(struct i2c_client *client)
 		.of_match_table = of_tps65218_match_table,
 	},
 	.probe		= tps65218_probe,
-	.remove		= tps65218_remove,
 	.id_table       = tps65218_id_table,
 };
 
-- 
1.9.1


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

* Re: [PATCH v3] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up  error path in probe
  2018-12-09 13:59 [PATCH v3] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Keerthy
@ 2018-12-09 22:45 ` Sebastian Reichel
  2018-12-14 12:41 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2018-12-09 22:45 UTC (permalink / raw)
  To: Keerthy; +Cc: tony, lee.jones, linux-omap, linux-kernel, t-kristo, ladis

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

Hi,

On Sun, Dec 09, 2018 at 07:29:31PM +0530, Keerthy wrote:
> Use devm_regmap_add_irq_chip and clean up error path in probe
> and also the remove function.
> 
> Reported-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

> 
> Changes in v2:
> 
>   * Cleaned up remove function as well.
> 
> Changes in v3:
> 
>   * Deleted the remove function which was just returning 0
> 
>  drivers/mfd/tps65218.c | 24 +++---------------------
>  1 file changed, 3 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
> index 910f569..8bcdecf 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,26 +253,9 @@ 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;
>  }
>  
> -static int tps65218_remove(struct i2c_client *client)
> -{
> -	struct tps65218 *tps = i2c_get_clientdata(client);
> -
> -	regmap_del_irq_chip(tps->irq, tps->irq_data);
> -
> -	return 0;
> -}
> -
>  static const struct i2c_device_id tps65218_id_table[] = {
>  	{ "tps65218", TPS65218 },
>  	{ },
> @@ -285,7 +268,6 @@ static int tps65218_remove(struct i2c_client *client)
>  		.of_match_table = of_tps65218_match_table,
>  	},
>  	.probe		= tps65218_probe,
> -	.remove		= tps65218_remove,
>  	.id_table       = tps65218_id_table,
>  };
>  
> -- 
> 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 v3] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up  error path in probe
  2018-12-09 13:59 [PATCH v3] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Keerthy
  2018-12-09 22:45 ` Sebastian Reichel
@ 2018-12-14 12:41 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2018-12-14 12:41 UTC (permalink / raw)
  To: Keerthy
  Cc: tony, linux-omap, linux-kernel, sebastian.reichel, t-kristo, ladis

On Sun, 09 Dec 2018, Keerthy wrote:

> Use devm_regmap_add_irq_chip and clean up error path in probe
> and also the remove function.
> 
> Reported-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> 
> Changes in v2:
> 
>   * Cleaned up remove function as well.
> 
> Changes in v3:
> 
>   * Deleted the remove function which was just returning 0
> 
>  drivers/mfd/tps65218.c | 24 +++---------------------
>  1 file changed, 3 insertions(+), 21 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2018-12-14 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 13:59 [PATCH v3] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Keerthy
2018-12-09 22:45 ` Sebastian Reichel
2018-12-14 12:41 ` Lee Jones

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).