summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-tb10x.c
diff options
context:
space:
mode:
authorVarka Bhadram <varkabhadram@gmail.com>2014-10-21 12:43:00 +0530
committerLinus Walleij <linus.walleij@linaro.org>2014-10-28 17:07:32 +0100
commitee2a9f7f06a5bff86cf3468fe74bf504640cf5e6 (patch)
treed2ebebfee023f211fc6b99eb6af61b985a6a45cc /drivers/gpio/gpio-tb10x.c
parentd9b53c3c4ce0657000cad1efbbcd95fdd699a7b6 (diff)
gpio: gpio-tb10x: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tb10x.c')
-rw-r--r--drivers/gpio/gpio-tb10x.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 9e615be8032c..8b1e8c0dd2fb 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -195,18 +195,13 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
if (of_property_read_u32(dn, "abilis,ngpio", &ngpio))
return -EINVAL;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!mem) {
- dev_err(&pdev->dev, "No memory resource defined.\n");
- return -EINVAL;
- }
-
tb10x_gpio = devm_kzalloc(&pdev->dev, sizeof(*tb10x_gpio), GFP_KERNEL);
if (tb10x_gpio == NULL)
return -ENOMEM;
spin_lock_init(&tb10x_gpio->spinlock);
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
tb10x_gpio->base = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(tb10x_gpio->base))
return PTR_ERR(tb10x_gpio->base);