From patchwork Wed Jul 17 11:41:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 2828554 Return-Path: X-Original-To: patchwork-linux-arm@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 E640DC0AB2 for ; Wed, 17 Jul 2013 11:45:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5BA420190 for ; Wed, 17 Jul 2013 11:45:43 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 314E52014C for ; Wed, 17 Jul 2013 11:45:42 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzQ9P-0008U9-Vv; Wed, 17 Jul 2013 11:44:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzQ9A-0008Kt-Gj; Wed, 17 Jul 2013 11:43:52 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzQ8r-0008Ik-MV for linux-arm-kernel@lists.infradead.org; Wed, 17 Jul 2013 11:43:35 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6HBhAHL003805; Wed, 17 Jul 2013 06:43:10 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6HBhAY8019037; Wed, 17 Jul 2013 06:43:10 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Wed, 17 Jul 2013 06:43:10 -0500 Received: from localhost (uglx0174654.ucm2.emeaucm.ext.ti.com [10.167.145.172]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6HBh9a6015088; Wed, 17 Jul 2013 06:43:10 -0500 From: Grygorii Strashko To: Tony Lindgren , Kevin Hilman Subject: [PATCH 1/3] pinctrl: rollback check for !dev->pins in pinctrl_pm_select*() APIs Date: Wed, 17 Jul 2013 14:41:50 +0300 Message-ID: <1374061312-25469-2-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374061312-25469-1-git-send-email-grygorii.strashko@ti.com> References: <1374061312-25469-1-git-send-email-grygorii.strashko@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130717_074334_083444_C68FFFC0 X-CRM114-Status: UNSURE ( 9.60 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.3 (-------) Cc: Grygorii Strashko , Stephen Warren , devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, Linus Walleij , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 The pinctrl support in Device core assumed to be optional - so, It's valid case, when there are no definition for default device's pinctrl states in DT at all ("default", "active", "idle", "sleep"). And in this case dev->pins == NULL and pinctrl_pm_select*() API should return 0 always. Now the checks for !dev->pins have been removed from pinctrl_pm_select*() API mistakenly by the patch pinctrl: Remove duplicate code in pinctrl_pm_select_state functions http://www.spinics.net/lists/arm-kernel/msg258829.html Hence, rollback these checks in in pinctrl_pm_select*() APIs. CC: Linus Walleij Cc: Stephen Warren Signed-off-by: Grygorii Strashko --- Seems this one can be squashed in series [PATCH 0/4] improved support for runtime muxing for pinctrl" http://www.spinics.net/lists/arm-kernel/msg258827.html drivers/pinctrl/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 4f58a97..ace4eb8 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -1390,6 +1390,9 @@ static int pinctrl_pm_select_state(struct device *dev, struct pinctrl_state *sta */ int pinctrl_pm_select_default_state(struct device *dev) { + if (!dev->pins) + return 0; + return pinctrl_pm_select_state(dev, dev->pins->default_state); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_default_state); @@ -1400,6 +1403,9 @@ EXPORT_SYMBOL_GPL(pinctrl_pm_select_default_state); */ int pinctrl_pm_select_active_state(struct device *dev) { + if (!dev->pins) + return 0; + return pinctrl_pm_select_state(dev, dev->pins->active_state); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_active_state); @@ -1410,6 +1416,9 @@ EXPORT_SYMBOL_GPL(pinctrl_pm_select_active_state); */ int pinctrl_pm_select_sleep_state(struct device *dev) { + if (!dev->pins) + return 0; + return pinctrl_pm_select_state(dev, dev->pins->sleep_state); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_sleep_state); @@ -1420,6 +1429,9 @@ EXPORT_SYMBOL_GPL(pinctrl_pm_select_sleep_state); */ int pinctrl_pm_select_idle_state(struct device *dev) { + if (!dev->pins) + return 0; + return pinctrl_pm_select_state(dev, dev->pins->idle_state); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_idle_state);