Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755278Ab2BUNJi (ORCPT ); Tue, 21 Feb 2012 08:09:38 -0500 Received: from mail-yx0-f174.google.com ([209.85.213.174]:56787 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754854Ab2BUNJh convert rfc822-to-8bit (ORCPT ); Tue, 21 Feb 2012 08:09:37 -0500 Authentication-Results: mr.google.com; spf=pass (google.com: domain of dongas86@gmail.com designates 10.236.123.109 as permitted sender) smtp.mail=dongas86@gmail.com; dkim=pass header.i=dongas86@gmail.com 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 21:09:36 +0800 Message-ID: Subject: Re: [PATCH 08/20] pinctrl: Assume map table entries can't have a NULL name field From: Dong Aisheng To: Linus Walleij 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: 2458 Lines: 66 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. > the have the driver ask for: > > sirfport->p = pinctrl_get(&pdev->dev, PIN_MAP_NAME_DEFAULT); > > (Similar changes can be done for U300, naming all its map > "default".) > Regards Dong Aisheng -- 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/