Commit a12730f6 authored by Richard Henderson's avatar Richard Henderson

[EISA] Update for moving "name" out of struct device.

parent dd14119a
...@@ -25,13 +25,12 @@ struct eisa_device_info { ...@@ -25,13 +25,12 @@ struct eisa_device_info {
char name[DEVICE_NAME_SIZE]; char name[DEVICE_NAME_SIZE];
}; };
static struct eisa_device_info __initdata eisa_table[] = {
#ifdef CONFIG_EISA_NAMES #ifdef CONFIG_EISA_NAMES
static struct eisa_device_info __initdata eisa_table[] = {
#include "devlist.h" #include "devlist.h"
#endif
}; };
#define EISA_INFOS (sizeof (eisa_table) / (sizeof (struct eisa_device_info))) #define EISA_INFOS (sizeof (eisa_table) / (sizeof (struct eisa_device_info)))
#endif
#define EISA_MAX_FORCED_DEV 16 #define EISA_MAX_FORCED_DEV 16
#define EISA_FORCED_OFFSET 2 #define EISA_FORCED_OFFSET 2
...@@ -59,11 +58,11 @@ static int is_forced_dev (int *forced_tab, ...@@ -59,11 +58,11 @@ static int is_forced_dev (int *forced_tab,
static void __init eisa_name_device (struct eisa_device *edev) static void __init eisa_name_device (struct eisa_device *edev)
{ {
#ifdef CONFIG_EISA_NAMES
int i; int i;
for (i = 0; i < EISA_INFOS; i++) { for (i = 0; i < EISA_INFOS; i++) {
if (!strcmp (edev->id.sig, eisa_table[i].id.sig)) { if (!strcmp (edev->id.sig, eisa_table[i].id.sig)) {
strlcpy (edev->dev.name, strlcpy (edev->pretty_name,
eisa_table[i].name, eisa_table[i].name,
DEVICE_NAME_SIZE); DEVICE_NAME_SIZE);
return; return;
...@@ -72,6 +71,7 @@ static void __init eisa_name_device (struct eisa_device *edev) ...@@ -72,6 +71,7 @@ static void __init eisa_name_device (struct eisa_device *edev)
/* No name was found */ /* No name was found */
sprintf (edev->dev.name, "EISA device %.7s", edev->id.sig); sprintf (edev->dev.name, "EISA device %.7s", edev->id.sig);
#endif
} }
static char __init *decode_eisa_sig(unsigned long addr) static char __init *decode_eisa_sig(unsigned long addr)
...@@ -172,7 +172,6 @@ static int __init eisa_init_device (struct eisa_root_device *root, ...@@ -172,7 +172,6 @@ static int __init eisa_init_device (struct eisa_root_device *root,
{ {
char *sig; char *sig;
unsigned long sig_addr; unsigned long sig_addr;
int i;
sig_addr = SLOT_ADDRESS (root, slot) + EISA_VENDOR_ID_OFFSET; sig_addr = SLOT_ADDRESS (root, slot) + EISA_VENDOR_ID_OFFSET;
...@@ -190,8 +189,13 @@ static int __init eisa_init_device (struct eisa_root_device *root, ...@@ -190,8 +189,13 @@ static int __init eisa_init_device (struct eisa_root_device *root,
edev->dev.dma_mask = &edev->dma_mask; edev->dev.dma_mask = &edev->dma_mask;
sprintf (edev->dev.bus_id, "%02X:%02X", root->bus_nr, slot); sprintf (edev->dev.bus_id, "%02X:%02X", root->bus_nr, slot);
for (i = 0; i < EISA_MAX_RESOURCES; i++) #ifdef CONFIG_EISA_NAMES
edev->res[i].name = edev->dev.name; {
int i;
for (i = 0; i < EISA_MAX_RESOURCES; i++)
edev->res[i].name = edev->pretty_name;
}
#endif
if (is_forced_dev (enable_dev, root, edev)) if (is_forced_dev (enable_dev, root, edev))
edev->state = EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED; edev->state = EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED;
...@@ -270,8 +274,7 @@ static int __init eisa_probe (struct eisa_root_device *root) ...@@ -270,8 +274,7 @@ static int __init eisa_probe (struct eisa_root_device *root)
int i, c; int i, c;
struct eisa_device *edev; struct eisa_device *edev;
printk (KERN_INFO "EISA: Probing bus %d at %s\n", printk (KERN_INFO "EISA: Probing bus %d\n", root->bus_nr);
root->bus_nr, root->dev->name);
/* First try to get hold of slot 0. If there is no device /* First try to get hold of slot 0. If there is no device
* here, simply fail, unless root->force_probe is set. */ * here, simply fail, unless root->force_probe is set. */
......
...@@ -42,6 +42,9 @@ struct eisa_device { ...@@ -42,6 +42,9 @@ struct eisa_device {
struct resource res[EISA_MAX_RESOURCES]; struct resource res[EISA_MAX_RESOURCES];
u64 dma_mask; u64 dma_mask;
struct device dev; /* generic device */ struct device dev; /* generic device */
#ifdef CONFIG_EISA_NAMES
char pretty_name[DEVICE_NAME_SIZE];
#endif
}; };
#define to_eisa_device(n) container_of(n, struct eisa_device, dev) #define to_eisa_device(n) container_of(n, struct eisa_device, dev)
......
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