Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755320Ab2BUNML (ORCPT ); Tue, 21 Feb 2012 08:12:11 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:53159 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755197Ab2BUNMJ convert rfc822-to-8bit (ORCPT ); Tue, 21 Feb 2012 08:12:09 -0500 Authentication-Results: mr.google.com; spf=pass (google.com: domain of linus.walleij@linaro.org designates 10.42.155.5 as permitted sender) smtp.mail=linus.walleij@linaro.org MIME-Version: 1.0 In-Reply-To: References: <1329720360-23227-1-git-send-email-swarren@nvidia.com> <1329720360-23227-9-git-send-email-swarren@nvidia.com> Date: Tue, 21 Feb 2012 14:12:08 +0100 Message-ID: Subject: Re: [PATCH 08/20] pinctrl: Assume map table entries can't have a NULL name field From: Linus Walleij To: Dong Aisheng Cc: Stephen Warren , Linus Walleij , B29396@freescale.com, s.hauer@pengutronix.de, shawn.guo@linaro.org, thomas.abraham@linaro.org, tony@atomide.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2655 Lines: 66 On Tue, Feb 21, 2012 at 2:09 PM, Dong Aisheng wrote: > On Tue, Feb 21, 2012 at 5:42 AM, Linus Walleij wrote: >> On Mon, Feb 20, 2012 at 7:45 AM, Stephen Warren wrote: >> >>> pinctrl_register_mappings() already requires that every mapping table >>> entry have a non-NULL name field. >>> >>> Logically, this makes sense too; drivers should always request a specific >>> named state so they know what they're getting. Relying on getting the >>> first mentioned state in the mapping table is error-prone, and a nasty >>> special case to implement, given that a given the mapping table may define >>> multiple states for a device. >>> >>> Update a few places in the code and documentation that still allowed for >>> NULL name fields. >>> >>> Signed-off-by: Stephen Warren >> >> This causes a regression on U300 and most certainly on the Sirf Prima II >> as well. The U300 can be fixed up as per below: >> >> diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c >> index bb1034f..66555d7 100644 >> --- a/arch/arm/mach-u300/core.c >> +++ b/arch/arm/mach-u300/core.c >> @@ -1645,7 +1645,7 @@ static int __init u300_pinctrl_fetch(void) >> ? ? ? ? ? ? ? ?struct pinctrl *p; >> ? ? ? ? ? ? ? ?int ret; >> >> - ? ? ? ? ? ? ? p = pinctrl_get(u300_mux_hogs[i].dev, NULL); >> + ? ? ? ? ? ? ? p = pinctrl_get(u300_mux_hogs[i].dev, u300_mux_hogs[i].name); >> ? ? ? ? ? ? ? ?if (IS_ERR(p)) { >> ? ? ? ? ? ? ? ? ? ? ? ?pr_err("u300: could not get pinmux hog %s\n", >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u300_mux_hogs[i].name); >> >> >> The drivers/tty/serial/sirfsoc_uart.c asks for it's UART pinctrl like >> this: >> >> sirfport->p = pinctrl_get(&pdev->dev, NULL); >> >> I don't know quite what to encode in there, if "deafult" is sensible >> we might just >> >> #define PIN_MAP_NAME_DEFAULT "default" >> In and alike, >> maybe in some that both of these >> include? >> > I feel a little strange to put such thing in common code. > Personally i still like the original way you did. I think with this patch alone it doesn't make much sense to enforce the request to specify a certain map, it only appears further ahead as we start to support states. Let's look through the entire patch series so as to get the bigger picture. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/