Re: [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers

From: Linus Walleij
Date: Tue Jun 25 2019 - 05:18:39 EST


On Mon, Jun 17, 2019 at 8:41 PM Enrico Weigelt, metux IT consult
<info@xxxxxxxxx> wrote:

> From: Enrico Weigelt <info@xxxxxxxxx>
>
> Add more helper macros for trivial driver init cases, similar to the
> already existing module_platform_driver()+friends - now for those which
> are initialized at other stages. Lots of drivers couldn't use the existing
> macros, as they need to be called at different init stages, eg. subsys,
> postcore, arch.
>
> This helps to further reduce driver init boilerplate.
>
> Signed-off-by: Enrico Weigelt <info@xxxxxxxxx>

You need to send this to Greg as device core maintainer.
Possibly to Rafael as well, he did a very intersting rework
on device dependencies with device links.

While in general I agree that this diets down a lot of duplicate
code that we have done the same way over and over, there
is the issue that we don't want any drivers to do this mockery
and instead use deferred probe and ultimately just probe in the
right order.

I think device links were supposed to fix this up, but it indeed
assumes that you know of these dependencies before you
start probing the first driver, and often you do not, unless the
hardware description explicitly encodes that. And that is one
big problem.

If we should do this, device core changes must be merged or
explicitly ACKed first.

Yours,
Linus Walleij