hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/regulator/stm32-pwr.c
....@@ -129,17 +129,16 @@
129129
130130 static int stm32_pwr_regulator_probe(struct platform_device *pdev)
131131 {
132
- struct device_node *np = pdev->dev.of_node;
133132 struct stm32_pwr_reg *priv;
134133 void __iomem *base;
135134 struct regulator_dev *rdev;
136135 struct regulator_config config = { };
137136 int i, ret = 0;
138137
139
- base = of_iomap(np, 0);
140
- if (!base) {
138
+ base = devm_platform_ioremap_resource(pdev, 0);
139
+ if (IS_ERR(base)) {
141140 dev_err(&pdev->dev, "Unable to map IO memory\n");
142
- return -ENOMEM;
141
+ return PTR_ERR(base);
143142 }
144143
145144 config.dev = &pdev->dev;