diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-pxa3xx.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-pxa3xx.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/pinctrl/pinctrl-pxa3xx.c b/drivers/pinctrl/pinctrl-pxa3xx.c index f14cd6ba4c0b..51f8a388b917 100644 --- a/drivers/pinctrl/pinctrl-pxa3xx.c +++ b/drivers/pinctrl/pinctrl-pxa3xx.c | |||
@@ -173,7 +173,6 @@ int pxa3xx_pinctrl_register(struct platform_device *pdev, | |||
173 | { | 173 | { |
174 | struct pinctrl_desc *desc; | 174 | struct pinctrl_desc *desc; |
175 | struct resource *res; | 175 | struct resource *res; |
176 | int ret = 0; | ||
177 | 176 | ||
178 | if (!info || !info->cputype) | 177 | if (!info || !info->cputype) |
179 | return -EINVAL; | 178 | return -EINVAL; |
@@ -188,23 +187,17 @@ int pxa3xx_pinctrl_register(struct platform_device *pdev, | |||
188 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 187 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
189 | if (!res) | 188 | if (!res) |
190 | return -ENOENT; | 189 | return -ENOENT; |
191 | info->phy_base = res->start; | 190 | info->virt_base = devm_request_and_ioremap(&pdev->dev, res); |
192 | info->phy_size = resource_size(res); | ||
193 | info->virt_base = ioremap(info->phy_base, info->phy_size); | ||
194 | if (!info->virt_base) | 191 | if (!info->virt_base) |
195 | return -ENOMEM; | 192 | return -ENOMEM; |
196 | info->pctrl = pinctrl_register(desc, &pdev->dev, info); | 193 | info->pctrl = pinctrl_register(desc, &pdev->dev, info); |
197 | if (!info->pctrl) { | 194 | if (!info->pctrl) { |
198 | dev_err(&pdev->dev, "failed to register PXA pinmux driver\n"); | 195 | dev_err(&pdev->dev, "failed to register PXA pinmux driver\n"); |
199 | ret = -EINVAL; | 196 | return -EINVAL; |
200 | goto err; | ||
201 | } | 197 | } |
202 | pinctrl_add_gpio_range(info->pctrl, &pxa3xx_pinctrl_gpio_range); | 198 | pinctrl_add_gpio_range(info->pctrl, &pxa3xx_pinctrl_gpio_range); |
203 | platform_set_drvdata(pdev, info); | 199 | platform_set_drvdata(pdev, info); |
204 | return 0; | 200 | return 0; |
205 | err: | ||
206 | iounmap(info->virt_base); | ||
207 | return ret; | ||
208 | } | 201 | } |
209 | 202 | ||
210 | int pxa3xx_pinctrl_unregister(struct platform_device *pdev) | 203 | int pxa3xx_pinctrl_unregister(struct platform_device *pdev) |
@@ -212,7 +205,6 @@ int pxa3xx_pinctrl_unregister(struct platform_device *pdev) | |||
212 | struct pxa3xx_pinmux_info *info = platform_get_drvdata(pdev); | 205 | struct pxa3xx_pinmux_info *info = platform_get_drvdata(pdev); |
213 | 206 | ||
214 | pinctrl_unregister(info->pctrl); | 207 | pinctrl_unregister(info->pctrl); |
215 | iounmap(info->virt_base); | ||
216 | platform_set_drvdata(pdev, NULL); | 208 | platform_set_drvdata(pdev, NULL); |
217 | return 0; | 209 | return 0; |
218 | } | 210 | } |