diff options
-rw-r--r-- | drivers/regulator/stw481x-vmmc.c | 8 | ||||
-rw-r--r-- | include/linux/mfd/stw481x.h | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/regulator/stw481x-vmmc.c b/drivers/regulator/stw481x-vmmc.c index 89025f560259..7d2ae3e9e942 100644 --- a/drivers/regulator/stw481x-vmmc.c +++ b/drivers/regulator/stw481x-vmmc.c | |||
@@ -56,6 +56,7 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev) | |||
56 | { | 56 | { |
57 | struct stw481x *stw481x = dev_get_platdata(&pdev->dev); | 57 | struct stw481x *stw481x = dev_get_platdata(&pdev->dev); |
58 | struct regulator_config config = { }; | 58 | struct regulator_config config = { }; |
59 | struct regulator_dev *rdev; | ||
59 | int ret; | 60 | int ret; |
60 | 61 | ||
61 | /* First disable the external VMMC if it's active */ | 62 | /* First disable the external VMMC if it's active */ |
@@ -75,12 +76,11 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev) | |||
75 | pdev->dev.of_node, | 76 | pdev->dev.of_node, |
76 | &vmmc_regulator); | 77 | &vmmc_regulator); |
77 | 78 | ||
78 | stw481x->vmmc_regulator = devm_regulator_register(&pdev->dev, | 79 | rdev = devm_regulator_register(&pdev->dev, &vmmc_regulator, &config); |
79 | &vmmc_regulator, &config); | 80 | if (IS_ERR(rdev)) { |
80 | if (IS_ERR(stw481x->vmmc_regulator)) { | ||
81 | dev_err(&pdev->dev, | 81 | dev_err(&pdev->dev, |
82 | "error initializing STw481x VMMC regulator\n"); | 82 | "error initializing STw481x VMMC regulator\n"); |
83 | return PTR_ERR(stw481x->vmmc_regulator); | 83 | return PTR_ERR(rdev); |
84 | } | 84 | } |
85 | 85 | ||
86 | dev_info(&pdev->dev, "initialized STw481x VMMC regulator\n"); | 86 | dev_info(&pdev->dev, "initialized STw481x VMMC regulator\n"); |
diff --git a/include/linux/mfd/stw481x.h b/include/linux/mfd/stw481x.h index eda121556e5d..833074b766bd 100644 --- a/include/linux/mfd/stw481x.h +++ b/include/linux/mfd/stw481x.h | |||
@@ -41,15 +41,11 @@ | |||
41 | 41 | ||
42 | /** | 42 | /** |
43 | * struct stw481x - state holder for the Stw481x drivers | 43 | * struct stw481x - state holder for the Stw481x drivers |
44 | * @mutex: mutex to serialize I2C accesses | ||
45 | * @i2c_client: corresponding I2C client | 44 | * @i2c_client: corresponding I2C client |
46 | * @regulator: regulator device for regulator children | ||
47 | * @map: regmap handle to access device registers | 45 | * @map: regmap handle to access device registers |
48 | */ | 46 | */ |
49 | struct stw481x { | 47 | struct stw481x { |
50 | struct mutex lock; | ||
51 | struct i2c_client *client; | 48 | struct i2c_client *client; |
52 | struct regulator_dev *vmmc_regulator; | ||
53 | struct regmap *map; | 49 | struct regmap *map; |
54 | }; | 50 | }; |
55 | 51 | ||