From patchwork Thu Oct 2 18:52:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 5020171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B6A799F3ED for ; Thu, 2 Oct 2014 18:55:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAFD2201FA for ; Thu, 2 Oct 2014 18:55:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 17DE2201F2 for ; Thu, 2 Oct 2014 18:55:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZlUe-0004l8-Sl; Thu, 02 Oct 2014 18:52:48 +0000 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZlUX-0004eb-6H for linux-arm-kernel@lists.infradead.org; Thu, 02 Oct 2014 18:52:41 +0000 Received: by mail-wi0-f176.google.com with SMTP id hi2so4981537wib.15 for ; Thu, 02 Oct 2014 11:52:18 -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=A7KrGKZzFBX5hOQyV4p3UsOao5Gmx+9TE++g7La0uMw=; b=qQyycjABmgqUsHMvAQo8t6oPzUYTRItwdaj9YIWtGotuXkwUUxzmmhp9c5BH1f87C2 DdRcIFjyRvdnMkOTjdDgZUu9LTGUu6KSFBVP2/zyB00VxSipCDei667r3QPkYH3e21SE c0n07TzUTlOjXTPaiR+D6mfNvyEaOdq195e7MotyKGH1ZagXg6TQARK5K7GVCvReAdSs /K57PDhG81TMgDJt0WK2KkIQgBo7SZxGh6huhNLVmsqXelDBHwX9q6lVI4+SOoGKQ4il 1x3ikAK5YcLRrqRyb81kG4Zz+IpBGRRmb5TeQPtWCvfIhajEqwtfF8Fa0NSrS3Z5EYkZ VyNA== X-Received: by 10.180.13.226 with SMTP id k2mr6276979wic.27.1412275938190; Thu, 02 Oct 2014 11:52:18 -0700 (PDT) Received: from flatron.lan (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id fv1sm5458192wjb.35.2014.10.02.11.52.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Oct 2014 11:52:17 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 1/5] pinctrl: samsung: Make samsung_pinctrl_get_soc_data use ERR_PTR() Date: Thu, 2 Oct 2014 20:52:07 +0200 Message-Id: <1412275931-10807-2-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1412275931-10807-1-git-send-email-tomasz.figa@gmail.com> References: <1412275931-10807-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141002_115241_380922_9A88AA1F X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: -0.8 (/) Cc: Linus Walleij , Tomasz Figa , linux-kernel@vger.kernel.org, Javier Martinez Canillas , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the function returns a valid pointer on success and NULL on error, so exact error code is lost. This patch changes return convention of the function to use ERR_PTR() on error instead. Signed-off-by: Tomasz Figa Tested-by: Marek Szyprowski Tested by: Javier Martinez Canillas --- drivers/pinctrl/samsung/pinctrl-samsung.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 4a47691c32b1..0504f0b75de8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -988,7 +988,7 @@ static struct samsung_pin_ctrl *samsung_pinctrl_get_soc_data( id = of_alias_get_id(node, "pinctrl"); if (id < 0) { dev_err(&pdev->dev, "failed to get alias id\n"); - return NULL; + return ERR_PTR(-ENOENT); } match = of_match_node(samsung_pinctrl_dt_match, node); ctrl = (struct samsung_pin_ctrl *)match->data + id; @@ -1040,9 +1040,9 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) } ctrl = samsung_pinctrl_get_soc_data(drvdata, pdev); - if (!ctrl) { + if (IS_ERR(ctrl)) { dev_err(&pdev->dev, "driver data not available\n"); - return -EINVAL; + return PTR_ERR(ctrl); } drvdata->ctrl = ctrl; drvdata->dev = dev;