Skip to content

Commit 8f2ef26

Browse files
committed
Input: zforce_ts - switch to using devm_regulator_get_enable()
The driver does not actively manage regulator state past probe() time, so we can use devm_regulator_get_enable() to simplify the code. Tested-by: Andreas Kemnade <[email protected]> # Tolino Shine2HD Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 16ff022 commit 8f2ef26

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/input/touchscreen/zforce_ts.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ struct zforce_ts {
107107
struct touchscreen_properties prop;
108108
char phys[32];
109109

110-
struct regulator *reg_vdd;
111-
112110
struct gpio_desc *gpio_int;
113111
struct gpio_desc *gpio_rst;
114112

@@ -675,11 +673,7 @@ static void zforce_reset(void *data)
675673
struct zforce_ts *ts = data;
676674

677675
zforce_reset_assert(ts);
678-
679676
udelay(10);
680-
681-
if (!IS_ERR(ts->reg_vdd))
682-
regulator_disable(ts->reg_vdd);
683677
}
684678

685679
static void zforce_ts_parse_legacy_properties(struct zforce_ts *ts)
@@ -742,16 +736,11 @@ static int zforce_probe(struct i2c_client *client)
742736
"failed to request reset GPIO\n");
743737
}
744738

745-
ts->reg_vdd = devm_regulator_get(&client->dev, "vdd");
746-
error = PTR_ERR_OR_ZERO(ts->gpio_rst);
739+
error = devm_regulator_get_enable(&client->dev, "vdd");
747740
if (error)
748741
return dev_err_probe(&client->dev, error,
749742
"failed to request vdd supply\n");
750743

751-
error = regulator_enable(ts->reg_vdd);
752-
if (error)
753-
return error;
754-
755744
/*
756745
* According to datasheet add 100us grace time after regular
757746
* regulator enable delay.

0 commit comments

Comments
 (0)