Re: [PATCH V2 3/3] pinctrl: Add Pistachio SoC pin control driver

From: Linus Walleij
Date: Tue Apr 07 2015 - 10:13:29 EST


On Tue, Mar 31, 2015 at 6:56 PM, Andrew Bresticker
<abrestic@xxxxxxxxxxxx> wrote:
> Hi Paul,
>
> On Tue, Mar 31, 2015 at 1:10 AM, Paul Bolle <pebolle@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/