diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-09-24 03:46:11 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-09-27 08:18:54 -0400 |
commit | c8690d6d2957ed060c1cba4cde3ec41e3829651b (patch) | |
tree | b632d00746a33936d24408e6577a120815cfb1fc /drivers/pinctrl/pinctrl-adi2.c | |
parent | 2467f1102dd117d4276498d30bb255796db7171c (diff) |
pinctrl: adi2: Convert to devm_ioremap_resource
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-adi2.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-adi2.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c index 7a24e59b4138..f2aa8773f4e3 100644 --- a/drivers/pinctrl/pinctrl-adi2.c +++ b/drivers/pinctrl/pinctrl-adi2.c | |||
@@ -855,22 +855,9 @@ static int adi_gpio_pint_probe(struct platform_device *pdev) | |||
855 | } | 855 | } |
856 | 856 | ||
857 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 857 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
858 | if (!res) { | 858 | pint->base = devm_ioremap_resource(dev, res); |
859 | dev_err(dev, "Invalid mem resource\n"); | 859 | if (IS_ERR(pint->base)) |
860 | return -ENODEV; | 860 | return PTR_ERR(pint->base); |
861 | } | ||
862 | |||
863 | if (!devm_request_mem_region(dev, res->start, resource_size(res), | ||
864 | pdev->name)) { | ||
865 | dev_err(dev, "Region already claimed\n"); | ||
866 | return -EBUSY; | ||
867 | } | ||
868 | |||
869 | pint->base = devm_ioremap(dev, res->start, resource_size(res)); | ||
870 | if (!pint->base) { | ||
871 | dev_err(dev, "Could not ioremap\n"); | ||
872 | return -ENOMEM; | ||
873 | } | ||
874 | 861 | ||
875 | pint->regs = (struct gpio_pint_regs *)pint->base; | 862 | pint->regs = (struct gpio_pint_regs *)pint->base; |
876 | 863 | ||
@@ -984,22 +971,9 @@ static int adi_gpio_probe(struct platform_device *pdev) | |||
984 | } | 971 | } |
985 | 972 | ||
986 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 973 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
987 | if (!res) { | 974 | port->base = devm_ioremap_resource(dev, res); |
988 | dev_err(dev, "Invalid mem resource\n"); | 975 | if (IS_ERR(port->base)) |
989 | return -ENODEV; | 976 | return PTR_ERR(port->base); |
990 | } | ||
991 | |||
992 | if (!devm_request_mem_region(dev, res->start, resource_size(res), | ||
993 | pdev->name)) { | ||
994 | dev_err(dev, "Region already claimed\n"); | ||
995 | return -EBUSY; | ||
996 | } | ||
997 | |||
998 | port->base = devm_ioremap(dev, res->start, resource_size(res)); | ||
999 | if (!port->base) { | ||
1000 | dev_err(dev, "Could not ioremap\n"); | ||
1001 | return -ENOMEM; | ||
1002 | } | ||
1003 | 977 | ||
1004 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 978 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
1005 | if (!res) | 979 | if (!res) |