diff mbox series

[2/2] Input: tps65219-pwrbutton - Use regmap_set_bits()

Message ID 20230605161458.117361-2-u.kleine-koenig@pengutronix.de (mailing list archive)
State Mainlined
Commit d9f12a3bbb6d1afe872425a8fa2612945975cfb8
Headers show
Series [1/2] Input: tps65219-pwrbutton - Convert to .remove_new() | expand

Commit Message

Uwe Kleine-König June 5, 2023, 4:14 p.m. UTC
regmap_set_bits() is equivalent to regmap_update_bits() if mask == val.
The probe function uses regmap_clear_bits() to enable irqs, so
symmetrically make use of regmap_set_bits() to disable them. There is no
semantic difference.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/input/misc/tps65219-pwrbutton.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Markus Schneider-Pargmann June 6, 2023, 9:20 a.m. UTC | #1
On Mon, Jun 05, 2023 at 06:14:58PM +0200, Uwe Kleine-König wrote:
> regmap_set_bits() is equivalent to regmap_update_bits() if mask == val.
> The probe function uses regmap_clear_bits() to enable irqs, so
> symmetrically make use of regmap_set_bits() to disable them. There is no
> semantic difference.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

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

Best,
Markus

> ---
>  drivers/input/misc/tps65219-pwrbutton.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/misc/tps65219-pwrbutton.c b/drivers/input/misc/tps65219-pwrbutton.c
> index b2d9e5d2bcfd..eeb9f2334ab4 100644
> --- a/drivers/input/misc/tps65219-pwrbutton.c
> +++ b/drivers/input/misc/tps65219-pwrbutton.c
> @@ -123,9 +123,8 @@ static void tps65219_pb_remove(struct platform_device *pdev)
>  	int ret;
>  
>  	/* Disable interrupt for the pushbutton */
> -	ret = regmap_update_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
> -				 TPS65219_REG_MASK_INT_FOR_PB_MASK,
> -				 TPS65219_REG_MASK_INT_FOR_PB_MASK);
> +	ret = regmap_set_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
> +			      TPS65219_REG_MASK_INT_FOR_PB_MASK);
>  	if (ret)
>  		dev_warn(&pdev->dev, "Failed to disable irq (%pe)\n", ERR_PTR(ret));
>  }
> -- 
> 2.39.2
>
Dmitry Torokhov June 6, 2023, 7:12 p.m. UTC | #2
On Mon, Jun 05, 2023 at 06:14:58PM +0200, Uwe Kleine-König wrote:
> regmap_set_bits() is equivalent to regmap_update_bits() if mask == val.
> The probe function uses regmap_clear_bits() to enable irqs, so
> symmetrically make use of regmap_set_bits() to disable them. There is no
> semantic difference.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/misc/tps65219-pwrbutton.c b/drivers/input/misc/tps65219-pwrbutton.c
index b2d9e5d2bcfd..eeb9f2334ab4 100644
--- a/drivers/input/misc/tps65219-pwrbutton.c
+++ b/drivers/input/misc/tps65219-pwrbutton.c
@@ -123,9 +123,8 @@  static void tps65219_pb_remove(struct platform_device *pdev)
 	int ret;
 
 	/* Disable interrupt for the pushbutton */
-	ret = regmap_update_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
-				 TPS65219_REG_MASK_INT_FOR_PB_MASK,
-				 TPS65219_REG_MASK_INT_FOR_PB_MASK);
+	ret = regmap_set_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
+			      TPS65219_REG_MASK_INT_FOR_PB_MASK);
 	if (ret)
 		dev_warn(&pdev->dev, "Failed to disable irq (%pe)\n", ERR_PTR(ret));
 }