Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754764AbbDQQja (ORCPT ); Fri, 17 Apr 2015 12:39:30 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:36153 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753949AbbDQQjY (ORCPT ); Fri, 17 Apr 2015 12:39:24 -0400 MIME-Version: 1.0 In-Reply-To: <553099AF.3060108@imgtec.com> References: <1428435862-14354-1-git-send-email-abrestic@chromium.org> <1428435862-14354-3-git-send-email-abrestic@chromium.org> <553099AF.3060108@imgtec.com> Date: Fri, 17 Apr 2015 09:39:23 -0700 X-Google-Sender-Auth: MfBrNMHP5SOjFmr-3-0G9Fm5HvQ Message-ID: Subject: Re: [PATCH V3 2/2] pinctrl: Add Pistachio SoC pin control driver From: Andrew Bresticker To: Ezequiel Garcia Cc: Linus Walleij , Alexandre Courbot , Ralf Baechle , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Linux-MIPS , "linux-kernel@vger.kernel.org" , James Hartley , James Hogan , Damien Horsley , Govindraj Raja , Kevin Cernekee , Paul Bolle Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1739 Lines: 51 Hi Ezequiel, On Thu, Apr 16, 2015 at 10:27 PM, Ezequiel Garcia wrote: > > Hi Andrew, > > On 04/07/2015 04:44 PM, Andrew Bresticker wrote: > [..] >> +static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) >> +{ >> + struct device_node *node = pctl->dev->of_node; >> + struct pistachio_gpio_bank *bank; >> + unsigned int i; >> + int irq, ret = 0; >> + >> + for (i = 0; i < pctl->nbanks; i++) { >> + char child_name[sizeof("gpioXX")]; >> + struct device_node *child; > > The first submission used for_each_child_of_node, and I can't find > any review comments explaining why you've changed it to a regular for > loop. The reason for this was the change to looking for particular node names (gpio0, gpio1, ...) instead of assuming they'd be in order. It seemed cleaner to me to do the above rather than: for_each_child_of_node() if (strcmp(node->name, ...) == 0) >> + >> + snprintf(child_name, sizeof(child_name), "gpio%d", i); > > This assumes the GPIO bank nodes are called gpio0, gpio1, ... and so on. > Do we really want to assume that? Linus suggested using aliases [1] in a previous review, but that obviously won't work when we have the RPU pinctrl as well since there will be multiple "gpio0"s, so I decided to use node names instead. The Rockchip and Samsung pinctrl drivers do something similar. [1] http://patchwork.linux-mips.org/patch/9307/ Thanks, Andrew -- 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/