diff mbox

[gpio,v2,2/3] gpio: gpio-stp-xway: remove duplicate check on resource

Message ID 1414478227-24674-3-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-stp-xway.c |    8 ++------
 1 file changed, 2 insertions(+), 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>

I've 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
diff mbox

Patch

diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index 7e359b7..7892e0f 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -199,21 +199,17 @@  static int xway_stp_hw_init(struct xway_stp *chip)
 
 static int xway_stp_probe(struct platform_device *pdev)
 {
-	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	struct resource *res;
 	const __be32 *shadow, *groups, *dsl, *phy;
 	struct xway_stp *chip;
 	struct clk *clk;
 	int ret = 0;
 
-	if (!res) {
-		dev_err(&pdev->dev, "failed to request STP resource\n");
-		return -ENOENT;
-	}
-
 	chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
 	if (!chip)
 		return -ENOMEM;
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	chip->virt = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(chip->virt))
 		return PTR_ERR(chip->virt);