linux/scripts/mod
Jean Delvare ac55182899 modpost: i2c aliases need no trailing wildcard
Not all device types need a wildcard at the end of their module
aliases. In particular, for i2c module aliases, the trailing wildcard
is not only unneeded, it could also cause the wrong driver to be
loaded.

As I2C devices have no IDs, i2c module aliases are simple, arbitrary
device names. For example:

$ /sbin/modinfo lm90
filename:       /lib/modules/2.6.25-git18/kernel/drivers/hwmon/lm90.ko
author:         Jean Delvare <khali@linux-fr.org>
description:    LM90/ADM1032 driver
license:        GPL
vermagic:       2.6.25-git18 mod_unload
depends:        hwmon
alias:          i2c:lm90*
alias:          i2c:adm1032*
alias:          i2c:lm99*
alias:          i2c:lm86*
alias:          i2c:max6657*
alias:          i2c:adt7461*
alias:          i2c:max6680*
$

This would cause trouble if one I2C chip name matches the beginning of
another I2C chip name and both chips are supported by different
drivers. For example, an i2c device named lm9042 would cause the lm90
driver to be loaded, while it doesn't support that device. This case
has yet to be seen in practice, but still, I'd like to fix it now. The
cleanest fix is to remove the trailing wildcard from i2c module aliases.

Here's a patch doing this.

Not all device type aliases need a trailing wildcard, in particular
the i2c aliases don't. Don't add a wildcard by default in do_table(),
instead let each device type handler add it if needed.

I have tested types acpi, dmi, eisa, i2c, ide, ieee1394, input, pci,
pcmcia, platform, pnp, scsi, serio, ssb and usb. Other types (ccw, of,
vio, parisc, sdio and virtio) are untested.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-05-04 09:24:47 +02:00
..
.gitignore Add some basic .gitignore files 2005-10-18 08:26:15 -07:00
empty.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file2alias.c modpost: i2c aliases need no trailing wildcard 2008-05-04 09:24:47 +02:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mk_elfconfig.c blackfin architecture 2007-05-07 12:12:58 -07:00
modpost.c kbuild: soften MODULE_LICENSE check 2008-04-26 21:07:26 +02:00
modpost.h kbuild: soften modpost checks when doing cross builds 2008-03-23 21:38:54 +01:00
sumversion.c kbuild: include limits.h in sumversion.c for PATH_MAX 2007-05-19 09:10:59 +02:00