From patchwork Tue Oct 28 06:37:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varka Bhadram X-Patchwork-Id: 404059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C8AEB140076 for ; Tue, 28 Oct 2014 17:40:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbaJ1GkU (ORCPT ); Tue, 28 Oct 2014 02:40:20 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:55732 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933889AbaJ1GkR (ORCPT ); Tue, 28 Oct 2014 02:40:17 -0400 Received: by mail-pd0-f177.google.com with SMTP id v10so34287pde.22 for ; Mon, 27 Oct 2014 23:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PcWJFX4PJR/ocZKiPuz+al3tz6pP/9NAxhhlGhRI7v8=; b=z8eWluVJOQVg7FsxlkbtiL63IWYe9JSbI6TgIrhX1oZPOQ9d0Aki2Id5Vtbc5arGN5 Fq/C1335Ddnj/51FyQCkHbWlEf2E3QogIB3970QM1OWcUJtJbhkIq30MYNpuz5wfwryr 7ersCRa9LgAULxk5JRBBxpepkSUsH+QfnXaLSDhOD+VDZokLRC9qB9/BwkiSLq84zSVv caSQTwSi5k0vEnXxDpN4cwgKRL3X2YIriQRB5myTHHDA5IzQUg4CPSZCbqQ10/C+aa6N h5pFrvuDaaPKta2qF4K2Brz/bKLGE6jTIZ361vI7PINswkJPoalkqVTGqITzVXxtDif4 ZLKA== X-Received: by 10.68.68.137 with SMTP id w9mr1040279pbt.71.1414478417214; Mon, 27 Oct 2014 23:40:17 -0700 (PDT) Received: from cdac.hyderabad.cdac.in ([196.12.45.164]) by mx.google.com with ESMTPSA id ql6sm653315pbb.39.2014.10.27.23.40.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 23:40:15 -0700 (PDT) From: Varka Bhadram X-Google-Original-From: Varka Bhadram To: linux-gpio@vger.kernel.org Cc: gnurou@gmail.com, linus.walleij@linaro.org, Varka Bhadram Subject: [PATCH gpio v2 2/3] gpio: gpio-stp-xway: remove duplicate check on resource Date: Tue, 28 Oct 2014 12:07:06 +0530 Message-Id: <1414478227-24674-3-git-send-email-varkab@cdac.in> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414478227-24674-1-git-send-email-varkab@cdac.in> References: <1414478227-24674-1-git-send-email-varkab@cdac.in> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram Acked-by: Alexandre Courbot --- drivers/gpio/gpio-stp-xway.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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);