Re: [PATCH] Minor change to platform_device_register_simple prototype

From: Russell King
Date: Thu Dec 08 2005 - 18:26:21 EST


On Thu, Dec 08, 2005 at 10:37:05PM +0100, Jean Delvare wrote:
> Hi Dmitry,
>
> > 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.

You're actually talking about driver model convention, which is that
if a driver for a device is missing, we do not return an error - a
hotplug event (or whatever is the flavour of the month) might provide
a driver.

For example, you might have a SMC91x device on your board, and you
may have chosen to build the driver as a module. You wouldn't want
the device to not register.

Why should a driver registering its own platform device be treated
any different (from any platform provided device or indeed the rest
of the device/driver model)?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
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/