Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756317AbeAIOdi (ORCPT + 1 other); Tue, 9 Jan 2018 09:33:38 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46858 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753230AbeAIOdf (ORCPT ); Tue, 9 Jan 2018 09:33:35 -0500 X-Google-Smtp-Source: ACJfBovkAzwAYYZz7rjRMQTsZ9rJcJV7PPp2okEkHtvUKaG1+PKsse+Vtoy6eO4PTAmiRNUa+Q0dqg== Date: Tue, 9 Jan 2018 15:33:29 +0100 From: Gary Bisson To: Stefan Agner Cc: linus.walleij@linaro.org, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, aisheng.dong@nxp.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Arvind Yadav Subject: Re: [PATCH v2 1/5] pinctrl: imx: use struct imx_pinctrl_soc_info as a const Message-ID: <20180109143329.GA23576@t450s.lan> References: <20180106142553.15322-1-stefan@agner.ch> <20180106142553.15322-2-stefan@agner.ch> <20180108164855.GA6504@t450s.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Stefan, On Mon, Jan 08, 2018 at 09:52:36PM +0100, Stefan Agner wrote: > On 2018-01-08 17:48, Gary Bisson wrote: > > Hi Stefan, > > > > On Sat, Jan 06, 2018 at 03:25:49PM +0100, Stefan Agner wrote: > >> For some SoCs the struct imx_pinctrl_soc_info is passed through > >> of_device_id.data which is const. Most variables are already const > >> or otherwise not written. However, some fields are modified at > >> runtime. Move those fields to the dynamically allocated struct > >> imx_pinctrl. > >> > >> Fixes: b3060044e495 ("pinctrl: freescale: imx7d: make of_device_ids const") > >> Cc: Shawn Guo > >> Cc: Arvind Yadav > >> Cc: Dong Aisheng > >> Cc: Gary Bisson > >> Signed-off-by: Stefan Agner > > > > This is actually more or less a revert of a previous commit: > > b28742be4709 pinctrl: imx: remove const qualifier of imx_pinctrl_soc_info > > Hm, I see. However, back then imx_pinctrl_probe still consumed a > non-const struct imx_pinctrl_soc_info pointer. So this constifies all > the way through. > > > > > Note that the idea for this commit was to get dt-overlays working and > > able to do pinctrl changes using configfs interface to load an overlay > > (using Pantelis patch). Not sure where we stand on loading such overlay > > from user-space, is it still something that will happen? > > I am all for dt-overlays and actually also hope that it will make it > completely into mainline. So whatever prevents using device tree > overlays should be addressed. > > It seems that ngroups is now part of struct pinctrl_dev (num_groups), > which is still writable. So we should be fine? Correct, I forgot about the generic pinmux/pinctrl patches. Indeed having the structure as const is perfectly fine now, even with dt-overlays in mind. Regards, Gary