From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH V2 3/3] pinctrl: Add Pistachio SoC pin control driver Date: Tue, 7 Apr 2015 16:13:16 +0200 Message-ID: References: <1427757416-14491-1-git-send-email-abrestic@chromium.org> <1427757416-14491-4-git-send-email-abrestic@chromium.org> <1427789415.2408.45.camel@x220> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-ie0-f169.google.com ([209.85.223.169]:34469 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755497AbbDGONR (ORCPT ); Tue, 7 Apr 2015 10:13:17 -0400 Received: by iedfl3 with SMTP id fl3so53833089ied.1 for ; Tue, 07 Apr 2015 07:13:16 -0700 (PDT) In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Andrew Bresticker Cc: Paul Bolle , Alexandre Courbot , Ralf Baechle , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Linux-MIPS , "linux-kernel@vger.kernel.org" , Ezequiel Garcia , James Hartley , James Hogan , Damien Horsley , Govindraj Raja , Kevin Cernekee On Tue, Mar 31, 2015 at 6:56 PM, Andrew Bresticker wrote: > Hi Paul, > > On Tue, Mar 31, 2015 at 1:10 AM, Paul Bolle wrote: >> The patch adds a mismatch between the Kconfig symbol (a bool) and the >> code (which suggests that a modular build is also possible). > > Nearly all of the pinctrl drivers (with the exception of qcom and > intel) are like this. They use a bool Kconfig symbol but they are > written so that they could be built as a module in the future. There are many aspects to this and I have no strong opinion, it doesn't really disturb me either way as both are familiar ways of writing drivers be it modular or not. I think it's more disturbing that bool drivers have .remove() functions, and as pointed out elsewhere this is because the module can still be bound/unbound from sysfs even if compiled into the kernel and then that code path will actually be executed. And as I remarked again, elsewhere, that can be overcome by adding the .suppress_bind_attrs = true to struct device_driver inside the platform driver. So if going through all the hazzle to remove anything compiled-out for non-modules, also take the step above removing .remove() calls and setting .suppress_bind_attrs. I will maybe do so sometime myself for any bool drivers... Yours, Linus Walleij