diff options
| author | Adam Belay <ambx1@neo.rr.com> | 2003-08-16 03:52:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-08-16 03:52:45 -0700 |
| commit | 7412360eb240108e9d34d77ee42e6dbfda536cff (patch) | |
| tree | c4b5e30ab66f35fdbd0a14b4aa442328d4c09915 | |
| parent | 2afa598083ad74ddfad57e3e316bd187e550ec28 (diff) | |
[PATCH] Remove remaining usage of device.name in PnP
This removes three remaining instances of device.name.
1.) the isapnp driver
2.) the protocol management code
3.) the pnp serial driver
A name field has been introduced to pnp_dev and pnp_card to
store human readable names reported by pnp.
| -rw-r--r-- | drivers/pnp/core.c | 1 | ||||
| -rw-r--r-- | drivers/pnp/isapnp/core.c | 8 | ||||
| -rw-r--r-- | drivers/serial/8250_pnp.c | 2 | ||||
| -rw-r--r-- | include/linux/pnp.h | 5 |
4 files changed, 9 insertions, 7 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index fcf32f876c4a..082adeae0717 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -69,7 +69,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol) protocol->number = nodenum; sprintf(protocol->dev.bus_id, "pnp%d", nodenum); - strlcpy(protocol->dev.name,protocol->name,DEVICE_NAME_SIZE); return device_register(&protocol->dev); } diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index b8e973c99b9f..acb3943281d7 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -743,7 +743,7 @@ static int __init isapnp_create_device(struct pnp_card *card, size = 0; break; case _LTAG_ANSISTR: - isapnp_parse_name(dev->dev.name, sizeof(dev->dev.name), &size); + isapnp_parse_name(dev->name, sizeof(dev->name), &size); break; case _LTAG_UNICODESTR: /* silently ignore */ @@ -808,7 +808,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card) case _STAG_VENDOR: break; case _LTAG_ANSISTR: - isapnp_parse_name(card->dev.name, sizeof(card->dev.name), &size); + isapnp_parse_name(card->name, sizeof(card->name), &size); break; case _LTAG_UNICODESTR: /* silently ignore */ @@ -1144,11 +1144,11 @@ int __init isapnp_init(void) protocol_for_each_card(&isapnp_protocol,card) { cards++; if (isapnp_verbose) { - printk(KERN_INFO "isapnp: Card '%s'\n", card->dev.name[0]?card->dev.name:"Unknown"); + printk(KERN_INFO "isapnp: Card '%s'\n", card->name[0]?card->name:"Unknown"); if (isapnp_verbose < 2) continue; card_for_each_dev(card,dev) { - printk(KERN_INFO "isapnp: Device '%s'\n", dev->dev.name[0]?dev->dev.name:"Unknown"); + printk(KERN_INFO "isapnp: Device '%s'\n", dev->name[0]?dev->name:"Unknown"); } } } diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index d21396e514e6..deb1ebe9ed9f 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c @@ -369,7 +369,7 @@ static int __devinit check_resources(struct pnp_option *option) */ static int __devinit serial_pnp_guess_board(struct pnp_dev *dev, int *flags) { - if (!(check_name(dev->dev.name) || (dev->card && check_name(dev->card->dev.name)))) + if (!(check_name(pnp_dev_name(dev)) || (dev->card && check_name(dev->card->name)))) return -ENODEV; if (check_resources(dev->independent)) diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 0bafd03cf91d..1dcef561a280 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -19,6 +19,7 @@ #define PNP_MAX_DMA 2 #define PNP_MAX_DEVICES 8 #define PNP_ID_LEN 8 +#define PNP_NAME_LEN 50 struct pnp_protocol; struct pnp_dev; @@ -133,6 +134,7 @@ struct pnp_card { struct pnp_protocol * protocol; struct pnp_id * id; /* contains supported EISA IDs*/ + char name[PNP_NAME_LEN]; /* contains a human-readable name */ unsigned char pnpver; /* Plug & Play version */ unsigned char productver; /* product version */ unsigned int serial; /* serial number */ @@ -187,6 +189,7 @@ struct pnp_dev { struct pnp_option * dependent; struct pnp_resource_table res; + char name[PNP_NAME_LEN]; /* contains a human-readable name */ unsigned short regs; /* ISAPnP: supported registers */ int flags; /* used by protocols */ struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ @@ -204,7 +207,7 @@ struct pnp_dev { for((dev) = card_to_pnp_dev((card)->devices.next); \ (dev) != card_to_pnp_dev(&(card)->devices); \ (dev) = card_to_pnp_dev((dev)->card_list.next)) -#define pnp_dev_name(dev) (dev)->dev.name +#define pnp_dev_name(dev) (dev)->name static inline void *pnp_get_drvdata (struct pnp_dev *pdev) { |
