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: 4959161 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 65EBE9F313 for ; Tue, 23 Sep 2014 19:08:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58F8B202A1 for ; Tue, 23 Sep 2014 19:08:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BCA220274 for ; Tue, 23 Sep 2014 19:08:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755322AbaIWTHx (ORCPT ); Tue, 23 Sep 2014 15:07:53 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:45094 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756536AbaIWTFt (ORCPT ); Tue, 23 Sep 2014 15:05:49 -0400 Received: by mail-we0-f170.google.com with SMTP id x48so3581333wes.29 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Kukjin Kim , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Tomasz Figa 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> 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.5 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=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;