Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-16-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+1 -12
+1 -12
drivers/input/touchscreen/zforce_ts.c
··· 107 107 struct touchscreen_properties prop; 108 108 char phys[32]; 109 109 110 - struct regulator *reg_vdd; 111 - 112 110 struct gpio_desc *gpio_int; 113 111 struct gpio_desc *gpio_rst; 114 112 ··· 673 675 struct zforce_ts *ts = data; 674 676 675 677 zforce_reset_assert(ts); 676 - 677 678 udelay(10); 678 - 679 - if (!IS_ERR(ts->reg_vdd)) 680 - regulator_disable(ts->reg_vdd); 681 679 } 682 680 683 681 static void zforce_ts_parse_legacy_properties(struct zforce_ts *ts) ··· 736 742 "failed to request reset GPIO\n"); 737 743 } 738 744 739 - ts->reg_vdd = devm_regulator_get(&client->dev, "vdd"); 740 - error = PTR_ERR_OR_ZERO(ts->gpio_rst); 745 + error = devm_regulator_get_enable(&client->dev, "vdd"); 741 746 if (error) 742 747 return dev_err_probe(&client->dev, error, 743 748 "failed to request vdd supply\n"); 744 - 745 - error = regulator_enable(ts->reg_vdd); 746 - if (error) 747 - return error; 748 749 749 750 /* 750 751 * According to datasheet add 100us grace time after regular