Re: [PATCH] Minor change to platform_device_register_simple prototype

Dmitry Torokhov
2005-12-08T21:49:42Z

On 12/8/05, Jean Delvare <khali@linux-fr.org> wrote:
> > Another thing - bunch of input code currently creates platform devices
> > but does not create corresponding platform drivers (because they don't
> > support suspend/resume or shutdown and probing is done right there in
> > module init function).
> >
> > What is the general policy on platform devices? Should they always have
> > a corresponding driver or is it OK to leave them without one?
>
> If it wasn't OK, I'd expect platform_device_alloc and
> platform_device_register to fail when no matching driver is found.
> Since they do not, I'd guess it is considered OK not to have a matching
> driver. But that's really only a guess and not a replacement for
> Russell's (or Greg's) authoritative answer.
>
> Reciprocally, if it is finally decided that it is *not* OK to have a
> platform device without a driver, they we want to make both functions
> mentioned above fail when no match is found.
>

I don't think so - some platforms could discover platform devices
separately from drivers being loaded (think separate modules). Then,
like with PCI, they would have devices without drivers... My question
was more along the loines "do we want to waste some memory registering
a driver that does absolutely nothing except for signalling userspace
that drive is indeed has a driver attached". And letting userspace
know that device is handled is probably a good thing.

--
Dmitry