Re: [PATCH 5/5] power: vexpress: make the reset driver a module

From: Arnd Bergmann
Date: Thu May 28 2020 - 06:29:31 EST


On Wed, May 27, 2020 at 3:32 PM Rob Herring <robh@xxxxxxxxxx> wrote:
>
> On Wed, May 27, 2020 at 5:26 AM Anders Roxell <anders.roxell@xxxxxxxxxx> wrote:
> >
> > Today the vexpress power driver can only be builtin. Rework so it's
> > possible for the vexpress power driver to be a module.
>
> This is the same incomplete patch I did[1]. As a module, it needs to
> clean-up everything probe did like overwriting global variables.
>
> Rob
>
> [1] https://lore.kernel.org/linux-arm-kernel/20200419170810.5738-5-robh@xxxxxxxxxx/

Your version was actually broken because it allowed unloading the
driver again. The version that Anders sent is a bit better because it
explicitly forbids unloading by having a module_init but not module_exit
function, so as long as the .suppress_bind_attrs flag is set, this will
not crash the kernel.

It would be nice to have a .remove callback, but for the merge window
I'm happy with a patch that fixes the build regression.

Arnd