From patchwork Tue Sep 23 19:05:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 4959171 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 8B4849F313 for ; Tue, 23 Sep 2014 19:08:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40AD920295 for ; Tue, 23 Sep 2014 19:08:25 +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 5D2ED20274 for ; Tue, 23 Sep 2014 19:08:24 +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 1XWVPn-00011r-H7; Tue, 23 Sep 2014 19:06:19 +0000 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWVPe-0000qU-Bx for linux-arm-kernel@lists.infradead.org; Tue, 23 Sep 2014 19:06:11 +0000 Received: by mail-wi0-f182.google.com with SMTP id d1so5831965wiv.9 for ; Tue, 23 Sep 2014 12:05:48 -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=Pe3dgWJzuk9zsj5qcmB+5NMqzjNIm/O0+PN//16m/kw=; b=Zn6Tv6z1jQ79TylSUaJ/vDzp32ZHOzYVvZfst7q8OYyntCk+zpDuMtUXaI60wrl1xu k6NszZUBF173pAgeABVevpFsJsJXGGkWHdgZoezgia64NNSGv+61TBNKJR+dLAeW3K8I eK2CV6LEJc9uDcWpUP35XUjAtgYSU5kuMRDay+/Po1ND2GpXH/QO8WEaF1Z7/NS9apRd d76dpMVNDbn1N0si9UQTN+LmjkS3MbdazVbCiKhaBBuzX+y9jP9a1AgJ2j6fFZ2epdul CBzKdFdPzz2XR2FjRwX4WNeCovrAMJHnlz/dCRjeLBx3WxA3iZPTpa7S/QbvK2R1Twlx R9dw== X-Received: by 10.194.246.2 with SMTP id xs2mr1826916wjc.33.1411499147965; Tue, 23 Sep 2014 12:05:47 -0700 (PDT) Received: from flatron.lan (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id pm6sm16888484wjb.36.2014.09.23.12.05.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Sep 2014 12:05:47 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/5] pinctrl: samsung: Make samsung_pinctrl_get_soc_data use ERR_PTR() Date: Tue, 23 Sep 2014 21:05:37 +0200 Message-Id: <1411499141-26551-2-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411499141-26551-1-git-send-email-tomasz.figa@gmail.com> References: <1411499141-26551-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140923_120610_555775_5D410D26 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -0.8 (/) Cc: Kukjin Kim , Bartlomiej Zolnierkiewicz , Linus Walleij , linux-kernel@vger.kernel.org, Tomasz Figa , 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.5 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 --- 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;