>       (possibly in a header)
>       #ifdef CONFIG_MY_BUS
>       #define MY_BUS_TYPE     &my_bus_type
>       #else
>       #define MY_BUS_TYPE     NULL
>       #endif
> 
> /drivers/my_driver.c
>       static struct platform_driver my_driver = {
>               .driver = {
>                       .name   = "my-driver",
>                       .owner  = THIS_MODULE,
>                       .bus    = MY_BUS_TYPE,
>               },
>       };
> 
> Which will allow the same driver to easily to used on either
> the platform bus or the newly defined bus type.

At compile time. I suspect there is an argument for having an
"ANY_BUS_TYPE" value for the devices so that you can runtime wildcard
stuff which works whatever sub-bus it is hung off.

> I believe this to be a fairly elegant and simple solution to the
> problem, but humbly RFC

It's exactly what I need to tidy up the SCU IPC devices on the new Intel
MID platforms certainly. It's also a very small patch to achieve it

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to