From patchwork Thu Sep 1 11:59:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 664904 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 3sQ16S07DWz9t1P for ; Thu, 1 Sep 2016 22:00:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933265AbcIAMA1 (ORCPT ); Thu, 1 Sep 2016 08:00:27 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:41103 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932232AbcIAMA0 (ORCPT ); Thu, 1 Sep 2016 08:00:26 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCT00WUVQN1RO50@mailout1.samsung.com>; Thu, 01 Sep 2016 20:59:25 +0900 (KST) X-AuditID: cbfee61a-f78ff6d000001462-91-57c8181d3f44 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id FD.EA.05218.D1818C75; Thu, 1 Sep 2016 20:59:25 +0900 (KST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OCT00862QMFA910@mmp1.samsung.com>; Thu, 01 Sep 2016 20:59:25 +0900 (KST) From: Sylwester Nawrocki To: linus.walleij@linaro.org Cc: tomasz.figa@gmail.com, k.kozlowski@samsung.com, b.zolnierkie@samsung.com, linux-gpio@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] pinctrl: samsung: Remove an always false dev->of_node test Date: Thu, 01 Sep 2016 13:59:00 +0200 Message-id: <1472731140-18034-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFJMWRmVeSWpSXmKPExsVy+t9jAV1ZiRPhBpPPi1hsnLGe1eL1C0OL KX+WM1lsnv+H0WLG+X1MFofftLNarNr1h9GB3WPnrLvsHneu7WHz6NuyitHj8ya5AJYoLpuU 1JzMstQifbsErozNd86zFbznrPjeuou5gXEGRxcjJ4eEgInEyeWP2CBsMYkL99YD2VwcQgJL GSWmXTkI5fxilLjc0cAMUsUmYCjRe7SPEcQWEZCRuDz7DztIEbPAHkaJj9uOs4IkhAW8Jf7s 7mMHsVkEVCX27GxhAbF5Bdwk7hyYArVOTuLkscmsExi5FzAyrGKUSC1ILihOSs81zEst1ytO zC0uzUvXS87P3cQIDpFnUjsYD+5yP8QowMGoxMPrFXg8XIg1say4MvcQowQHs5IIb4TIiXAh 3pTEyqrUovz4otKc1OJDjNIcLErivI//rwsTEkhPLEnNTk0tSC2CyTJxcEo1MFbrP3B5JbFj 8bv1apVGCs0J+d1lUefPiMWZ7Hiksr3Oc9WzSWeEuUq3FV6d7Fpg55t9/mBtv1WSXevUBy5u ZVEFHyyOt8z8w/fUOVLwxNypb5jk4ueZ3TjOp7po3e+/nl+XLOC/5mDxcrcZm3HdJiOb7BnO XfHSinUOd01EDnQtkeMy8Fu4VomlOCPRUIu5qDgRADpnuywNAgAA Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org samsung_pinctrl_probe() can be called only after matching the driver by the compatible string so this already implies a non null dev->of_node. Remove the always false test and related error trace. While at it drop another error log in case of memory allocation failure - any errors are logged by the memory subsystem. Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 513fe6b..620727f 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1041,17 +1041,9 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) struct resource *res; int ret; - if (!dev->of_node) { - dev_err(dev, "device tree node not found\n"); - return -ENODEV; - } - drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); - if (!drvdata) { - dev_err(dev, "failed to allocate memory for driver's " - "private data\n"); + if (!drvdata) return -ENOMEM; - } ctrl = samsung_pinctrl_get_soc_data(drvdata, pdev); if (IS_ERR(ctrl)) {