Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966688AbbBCUQM (ORCPT ); Tue, 3 Feb 2015 15:16:12 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:64732 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756285AbbBCUQI (ORCPT ); Tue, 3 Feb 2015 15:16:08 -0500 X-IronPort-AV: E=Sophos;i="5.09,514,1418112000"; d="scan'208";a="56088799" Message-ID: <54D12C84.9020505@broadcom.com> Date: Tue, 3 Feb 2015 12:16:04 -0800 From: Ray Jui User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dmitry Torokhov CC: Linus Walleij , Stephen Warren , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "Grant Likely" , Christian Daudt , Matt Porter , Florian Fainelli , Russell King , Scott Branden , Anatol Pomazau , , , , , Subject: Re: [PATCH v3 3/4] pinctrl: cygnus: add initial IOMUX driver support References: <1422928894-20716-1-git-send-email-rjui@broadcom.com> <1422928894-20716-4-git-send-email-rjui@broadcom.com> <20150203174042.GA15969@dtor-ws> <54D121A0.6070602@broadcom.com> <20150203200009.GB15969@dtor-ws> In-Reply-To: <20150203200009.GB15969@dtor-ws> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1379 Lines: 44 On 2/3/2015 12:00 PM, Dmitry Torokhov wrote: > On Tue, Feb 03, 2015 at 11:29:36AM -0800, Ray Jui wrote: >> On 2/3/2015 9:40 AM, Dmitry Torokhov wrote: >>> On Mon, Feb 02, 2015 at 06:01:33PM -0800, Ray Jui wrote: >>>> + >>>> +/* >>>> + * List of pins in Cygnus >>>> + */ >>>> +static struct cygnus_pin cygnus_pins[] = { >>> >>> const? >>> >> I cannot make it const here, since the address of "gpio_mux" is later >> passed to pinctrl_pin_desc's private data: >> >> pins[i].drv_data = &cygnus_pins[i].gpio_mux; > > The pinctrl code says: > > "@drv_data: driver-defined per-pin data. pinctrl core does not touch > this" > > so we could theoretically cast away the constness and restore it when > we access drv_data in pin control methods, but I won't insist. I am > not sure which way looks nicer. > > Thanks. > Yeah, I agreed that by declaring the cygnus_pins array const, it makes it more obvious that "we do not expect any of its parameters to change." But later if we cast &gpio_mux to void * before assigned to drv_data of pinctrl_pin_desc, we sort of break it up...I'll keep this part of code as it is for now. Thanks, Ray -- 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/