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: 5020141 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 947C2C11AB for ; Thu, 2 Oct 2014 18:53:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 925DC201F5 for ; Thu, 2 Oct 2014 18:53:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 767E22020F for ; Thu, 2 Oct 2014 18:53:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842AbaJBSwZ (ORCPT ); Thu, 2 Oct 2014 14:52:25 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:62495 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751703AbaJBSwT (ORCPT ); Thu, 2 Oct 2014 14:52:19 -0400 Received: by mail-wg0-f46.google.com with SMTP id l18so1136577wgh.29 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Marek Szyprowski , Javier Martinez Canillas , Tomasz Figa 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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;