[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN7PR03MB7132B49CE99BBB1CFB53E7F38E5FA@SN7PR03MB7132.namprd03.prod.outlook.com>
Date: Mon, 19 Jun 2023 06:05:06 +0000
From: "Hennerich, Michael" <Michael.Hennerich@...log.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Dmitry Torokhov <dmitry.torokhov@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>
Subject: RE: [PATCH] Input: adp5588-keys - Use devm_regulator_get_enable()
> -----Original Message-----
> From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Sent: Samstag, 17. Juni 2023 09:12
> To: Hennerich, Michael <Michael.Hennerich@...log.com>; Dmitry Torokhov
> <dmitry.torokhov@...il.com>
> Cc: linux-kernel@...r.kernel.org; kernel-janitors@...r.kernel.org; Christophe
> JAILLET <christophe.jaillet@...adoo.fr>; linux-input@...r.kernel.org
> Subject: [PATCH] Input: adp5588-keys - Use devm_regulator_get_enable()
>
> Use devm_regulator_get_enable() instead of hand writing it. It saves some line
> of code.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Acked-by: Michael Hennerich <michael.hennerich@...log.com>
> ---
> drivers/input/keyboard/adp5588-keys.c | 17 +----------------
> 1 file changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/drivers/input/keyboard/adp5588-keys.c
> b/drivers/input/keyboard/adp5588-keys.c
> index 896a5a989ddc..61e8e43e9c2b 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -713,17 +713,11 @@ static int adp5588_fw_parse(struct adp5588_kpad
> *kpad)
> return 0;
> }
>
> -static void adp5588_disable_regulator(void *reg) -{
> - regulator_disable(reg);
> -}
> -
> static int adp5588_probe(struct i2c_client *client) {
> struct adp5588_kpad *kpad;
> struct input_dev *input;
> struct gpio_desc *gpio;
> - struct regulator *vcc;
> unsigned int revid;
> int ret;
> int error;
> @@ -749,16 +743,7 @@ static int adp5588_probe(struct i2c_client *client)
> if (error)
> return error;
>
> - vcc = devm_regulator_get(&client->dev, "vcc");
> - if (IS_ERR(vcc))
> - return PTR_ERR(vcc);
> -
> - error = regulator_enable(vcc);
> - if (error)
> - return error;
> -
> - error = devm_add_action_or_reset(&client->dev,
> - adp5588_disable_regulator, vcc);
> + error = devm_regulator_get_enable(&client->dev, "vcc");
> if (error)
> return error;
>
> --
> 2.34.1
Powered by blists - more mailing lists