Commit 7412360e authored by Adam Belay's avatar Adam Belay Committed by Linus Torvalds

[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.
parent 2afa5980
...@@ -69,7 +69,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol) ...@@ -69,7 +69,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
protocol->number = nodenum; protocol->number = nodenum;
sprintf(protocol->dev.bus_id, "pnp%d", nodenum); sprintf(protocol->dev.bus_id, "pnp%d", nodenum);
strlcpy(protocol->dev.name,protocol->name,DEVICE_NAME_SIZE);
return device_register(&protocol->dev); return device_register(&protocol->dev);
} }
......
...@@ -743,7 +743,7 @@ static int __init isapnp_create_device(struct pnp_card *card, ...@@ -743,7 +743,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
size = 0; size = 0;
break; break;
case _LTAG_ANSISTR: case _LTAG_ANSISTR:
isapnp_parse_name(dev->dev.name, sizeof(dev->dev.name), &size); isapnp_parse_name(dev->name, sizeof(dev->name), &size);
break; break;
case _LTAG_UNICODESTR: case _LTAG_UNICODESTR:
/* silently ignore */ /* silently ignore */
...@@ -808,7 +808,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card) ...@@ -808,7 +808,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card)
case _STAG_VENDOR: case _STAG_VENDOR:
break; break;
case _LTAG_ANSISTR: case _LTAG_ANSISTR:
isapnp_parse_name(card->dev.name, sizeof(card->dev.name), &size); isapnp_parse_name(card->name, sizeof(card->name), &size);
break; break;
case _LTAG_UNICODESTR: case _LTAG_UNICODESTR:
/* silently ignore */ /* silently ignore */
...@@ -1144,11 +1144,11 @@ int __init isapnp_init(void) ...@@ -1144,11 +1144,11 @@ int __init isapnp_init(void)
protocol_for_each_card(&isapnp_protocol,card) { protocol_for_each_card(&isapnp_protocol,card) {
cards++; cards++;
if (isapnp_verbose) { 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) if (isapnp_verbose < 2)
continue; continue;
card_for_each_dev(card,dev) { 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");
} }
} }
} }
......
...@@ -369,7 +369,7 @@ static int __devinit check_resources(struct pnp_option *option) ...@@ -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) 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; return -ENODEV;
if (check_resources(dev->independent)) if (check_resources(dev->independent))
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#define PNP_MAX_DMA 2 #define PNP_MAX_DMA 2
#define PNP_MAX_DEVICES 8 #define PNP_MAX_DEVICES 8
#define PNP_ID_LEN 8 #define PNP_ID_LEN 8
#define PNP_NAME_LEN 50
struct pnp_protocol; struct pnp_protocol;
struct pnp_dev; struct pnp_dev;
...@@ -133,6 +134,7 @@ struct pnp_card { ...@@ -133,6 +134,7 @@ struct pnp_card {
struct pnp_protocol * protocol; struct pnp_protocol * protocol;
struct pnp_id * id; /* contains supported EISA IDs*/ 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 pnpver; /* Plug & Play version */
unsigned char productver; /* product version */ unsigned char productver; /* product version */
unsigned int serial; /* serial number */ unsigned int serial; /* serial number */
...@@ -187,6 +189,7 @@ struct pnp_dev { ...@@ -187,6 +189,7 @@ struct pnp_dev {
struct pnp_option * dependent; struct pnp_option * dependent;
struct pnp_resource_table res; struct pnp_resource_table res;
char name[PNP_NAME_LEN]; /* contains a human-readable name */
unsigned short regs; /* ISAPnP: supported registers */ unsigned short regs; /* ISAPnP: supported registers */
int flags; /* used by protocols */ int flags; /* used by protocols */
struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */
...@@ -204,7 +207,7 @@ struct pnp_dev { ...@@ -204,7 +207,7 @@ struct pnp_dev {
for((dev) = card_to_pnp_dev((card)->devices.next); \ for((dev) = card_to_pnp_dev((card)->devices.next); \
(dev) != card_to_pnp_dev(&(card)->devices); \ (dev) != card_to_pnp_dev(&(card)->devices); \
(dev) = card_to_pnp_dev((dev)->card_list.next)) (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) static inline void *pnp_get_drvdata (struct pnp_dev *pdev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment