[gpio,v2,3/3] gpio: gpio-tb10x: remove duplicate check on resource
diff mbox

Message ID 1414478227-24674-4-git-send-email-varkab@cdac.in
State Accepted
Headers show

Commit Message

Varka Bhadram Oct. 28, 2014, 6:37 a.m. UTC
Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpio/gpio-tb10x.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Linus Walleij Oct. 31, 2014, 8:05 a.m. UTC | #1
On Tue, Oct 28, 2014 at 7:37 AM, Varka Bhadram <varkabhadram@gmail.com> wrote:

> Sanity check on resource happening with devm_ioremap_resource().
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>

Already applied a version of this patch.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 9e615be..8b1e8c0 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);