Input: adp5588-keys - Use devm_regulator_get_enable()
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- drivers/input/keyboard/adp5588-keys.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)
drivers/input/keyboard/adp5588-keys.c +1 -16
@@ -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;
Signature · 1 line
2.34.1
Quoted 11 lines
-----Original Message-----
From: Christophe JAILLET <[email protected]>
Sent: Samstag, 17. Juni 2023 09:12
To: Hennerich, Michael <[email protected]>; Dmitry Torokhov <[email protected]>
Cc: [email protected]; [email protected]; Christophe JAILLET <[email protected]>; [email protected]
Subject: [PATCH] Input: adp5588-keys - Usedevm_regulator_get_enable()
Quoted 4 lines
Use
devm_regulator_get_enable()instead of hand writing it. It saves some line of code.Signed-off-by Christophe JAILLET <[email protected]>
Quoted 46 lines
--- drivers/input/keyboard/adp5588-keys.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)drivers/input/keyboard/adp5588-keys.c +1
-16@@ -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
Quoted 4 lines · Christophe JAILLET
Use
devm_regulator_get_enable()instead of hand writing it. It saves some line of code.Signed-off-by Christophe JAILLET <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry