| .. | .. |
|---|
| 129 | 129 | |
|---|
| 130 | 130 | static int stm32_pwr_regulator_probe(struct platform_device *pdev) |
|---|
| 131 | 131 | { |
|---|
| 132 | | - struct device_node *np = pdev->dev.of_node; |
|---|
| 133 | 132 | struct stm32_pwr_reg *priv; |
|---|
| 134 | 133 | void __iomem *base; |
|---|
| 135 | 134 | struct regulator_dev *rdev; |
|---|
| 136 | 135 | struct regulator_config config = { }; |
|---|
| 137 | 136 | int i, ret = 0; |
|---|
| 138 | 137 | |
|---|
| 139 | | - base = of_iomap(np, 0); |
|---|
| 140 | | - if (!base) { |
|---|
| 138 | + base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 139 | + if (IS_ERR(base)) { |
|---|
| 141 | 140 | dev_err(&pdev->dev, "Unable to map IO memory\n"); |
|---|
| 142 | | - return -ENOMEM; |
|---|
| 141 | + return PTR_ERR(base); |
|---|
| 143 | 142 | } |
|---|
| 144 | 143 | |
|---|
| 145 | 144 | config.dev = &pdev->dev; |
|---|