Skip to content

Commit 27fdd3b

Browse files
alistair23broonie
authored andcommitted
regulator: sy7636a: Use the regmap directly
Signed-off-by: Alistair Francis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d38d49b commit 27fdd3b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/regulator/sy7636a-regulator.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/mfd/sy7636a.h>
1515

1616
struct sy7636a_data {
17-
struct sy7636a *sy7636a;
17+
struct regmap *regmap;
1818
struct gpio_desc *pgood_gpio;
1919
};
2020

@@ -70,14 +70,14 @@ static const struct regulator_desc desc = {
7070

7171
static int sy7636a_regulator_probe(struct platform_device *pdev)
7272
{
73-
struct sy7636a *sy7636a = dev_get_drvdata(pdev->dev.parent);
73+
struct regmap *regmap = dev_get_drvdata(pdev->dev.parent);
7474
struct regulator_config config = { };
7575
struct regulator_dev *rdev;
7676
struct gpio_desc *gdp;
7777
struct sy7636a_data *data;
7878
int ret;
7979

80-
if (!sy7636a)
80+
if (!regmap)
8181
return -EPROBE_DEFER;
8282

8383
gdp = devm_gpiod_get(pdev->dev.parent, "epd-pwr-good", GPIOD_IN);
@@ -90,21 +90,20 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
9090
if (!data)
9191
return -ENOMEM;
9292

93-
data->sy7636a = sy7636a;
93+
data->regmap = regmap;
9494
data->pgood_gpio = gdp;
9595

9696
platform_set_drvdata(pdev, data);
9797

98-
ret = regmap_write(sy7636a->regmap, SY7636A_REG_POWER_ON_DELAY_TIME, 0x0);
98+
ret = regmap_write(regmap, SY7636A_REG_POWER_ON_DELAY_TIME, 0x0);
9999
if (ret) {
100100
dev_err(pdev->dev.parent, "Failed to initialize regulator: %d\n", ret);
101101
return ret;
102102
}
103103

104104
config.dev = &pdev->dev;
105105
config.dev->of_node = pdev->dev.parent->of_node;
106-
config.driver_data = sy7636a;
107-
config.regmap = sy7636a->regmap;
106+
config.regmap = regmap;
108107

109108
rdev = devm_regulator_register(&pdev->dev, &desc, &config);
110109
if (IS_ERR(rdev)) {

0 commit comments

Comments
 (0)