[i2c] [patch 2/8] I2C: S3C2410: Add MODULE_ALIAS() for s3c2440 device.
Ben Dooks
ben-linux at fluff.org
Sun Jun 1 23:51:02 CEST 2008
On Fri, May 30, 2008 at 09:54:52PM +0200, Jean Delvare wrote:
> Hi Ben,
>
> On Thu, 29 May 2008 14:22:46 +0100, Ben Dooks wrote:
> > Add a MODULE_ALIAS() statement for the i2c-s3c2410 controller
> > to ensure that it can be autoloaded on the S3C2440 systems that
> > we support.
> >
> > Signed-off-by: Ben Dooks <ben-linux at fluff.org>
> >
> > Index: linux-2.6.26-rc4-quilt1/drivers/i2c/busses/i2c-s3c2410.c
> > ===================================================================
> > --- linux-2.6.26-rc4-quilt1.orig/drivers/i2c/busses/i2c-s3c2410.c 2008-05-28 11:56:54.000000000 +0100
> > +++ linux-2.6.26-rc4-quilt1/drivers/i2c/busses/i2c-s3c2410.c 2008-05-28 11:57:12.000000000 +0100
> > @@ -947,3 +947,4 @@ MODULE_DESCRIPTION("S3C24XX I2C Bus driv
> > MODULE_AUTHOR("Ben Dooks, <ben at simtec.co.uk>");
> > MODULE_LICENSE("GPL");
> > MODULE_ALIAS("platform:s3c2410-i2c");
> > +MODULE_ALIAS("platform:s3c2440-i2c");
>
> With the current driver code, that's correct.
>
> Acked-by: Jean Delvare <khali at linux-fr.org>
>
> That being said, I think the approach is wrong. You shouldn't register
> two different platform drivers just to be able to differentiate between
> device types. You have platform_data for that, it's cleaner and cheaper.
Actually, there are down sides to doing it via platform data, and a few
upsides to using the driver model. I do agree that >1 driver does mean
that you end up allocating more space to the drivers, but I hope that
I can convince you that this isn't without merit.
The following are downsides:
1) using platform data means that not only do all the boards that have
i2c busses on (or other peripherals using this method) need to carry[1]
and register platform data even if they do not need to.
2) We currently change the name of the platform device in the cpu specific
architecture initialisation, which would mean either moving this to each
machine or have some form of sharing between the arch code and the board
init.
3) Some boards can have more than one cpu type on them, which makes life
even worse for the above.
The advantage of changing the name of the platform device means that the
type of device is shown in the /sys/devices/platform heirachy without any
need for code to add a new attribute to show it within the device itself.
[1] Even if this is __initdata, it means the kernel has to carry it to
load it even if it gets dumped at startup, and we have a number of
boards that are available.
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
More information about the i2c
mailing list