From: Bjorn Helgaas Date: Fri, 11 Apr 2008 04:29:28 +0000 (-0700) Subject: pnp: increase number of devices supported per protocol X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=544451a1a36b06f43fc67112ede3b92e6203eb9d;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git pnp: increase number of devices supported per protocol Increase the PNP "number of devices" limit. We currently use an unsigned char, which limits us to 256 devices per protocol. This patch changes that to an unsigned int. Not all backends can take advantage of this: we limit ISAPNP to 10 devices in isapnp_cfg_begin(), and PNPBIOS is limited to 256 devices because the BIOS interfaces use a one-byte device node number. But there is no limit on the number of PNPACPI devices we may have. Large HP Integrity machines have more than 256, which causes the current "unsigned char number" to wrap around. This causes errors like this: pnp: PnP ACPI init kobject_add failed for 00:00 with -EEXIST, don't try to register things with the same name in the same directory. Call Trace: [] show_stack+0x40/0xa0 [] dump_stack+0x30/0x60 [] kobject_add+0x290/0x2c0 [] device_add+0x160/0x860 [] device_register+0x30/0x60 [] __pnp_add_device+0x130/0x180 [] pnp_add_device+0xb0/0xe0 [] pnpacpi_add_device+0x510/0x5a0 [] pnpacpi_add_device_handler+0x50/0x80 This patch increases the limit to fix this PNPACPI problem. It should not have any adverse effect on ISAPNP or PNPBIOS because their limits are still enforced in the backends. Signed-off-by: Bjorn Helgaas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 29dd55838e84..b2f05c230f4b 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -175,7 +175,7 @@ static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data) struct pnp_dev { struct device dev; /* Driver Model device interface */ u64 dma_mask; - unsigned char number; /* used as an index, must be unique */ + unsigned int number; /* used as an index, must be unique */ int status; struct list_head global_list; /* node in global list of devices */