Question2: Determine subarch type

Alexander Shiyan shc_work at mail.ru
Sun Dec 9 05:24:05 EST 2012


On Sun, 9 Dec 2012 10:13:59 +0000
Russell King - ARM Linux <linux at arm.linux.org.uk> wrote:

> > > > How can we determine the sub-architecture type from the driver code?
> > > > For example, we are building a multi-platform kernel for subarch A and B.
> > > > One of the drivers should be used for subarch A only, and can not be used for
> > > > subarch B. So, we need to avoid load this driver for other sub-architectures.
> > > > Of course, we can check all machines in the subarch with machine_is_xx() macro,
> > > > but I think that this is not the best way to do it.
> > > > Do we have another way to do this?
> > > 
> > > You control this by only registering the appropriate struct devices rather
> > > than controlling this in the driver.
> > 
> > Yes, but if driver is compiled as module?
> 
> Makes no difference.

Do you mean that all the drivers for multi-platform targets should be
converted to platform_drivers?
OK, and what about (arch/fs/core/postcore)_initcall-s? Current multiplatform
targets use these calls.

-- 
Alexander Shiyan <shc_work at mail.ru>



More information about the linux-arm-kernel mailing list