Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36204
b: refs/heads/master
c: 07563c7
h: refs/heads/master
v: v3
  • Loading branch information
Michael Tokarev authored and Linus Torvalds committed Sep 27, 2006
1 parent 9a88fae commit e21f1e9
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebba5f9fcb882306bef7175dee987342ec6fcf2f
refs/heads/master: 07563c711fbc25389e58ab9c9f0b9de2fce56760
23 changes: 23 additions & 0 deletions trunk/drivers/eisa/eisa-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,23 @@ static int eisa_bus_match (struct device *dev, struct device_driver *drv)
return 0;
}

static int eisa_bus_uevent(struct device *dev, char **envp, int num_envp,
char *buffer, int buffer_size)
{
struct eisa_device *edev = to_eisa_device(dev);
int i = 0;
int length = 0;

add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
"MODALIAS=" EISA_DEVICE_MODALIAS_FMT, edev->id.sig);
envp[i] = NULL;
return 0;
}

struct bus_type eisa_bus_type = {
.name = "eisa",
.match = eisa_bus_match,
.uevent = eisa_bus_uevent,
};

int eisa_driver_register (struct eisa_driver *edrv)
Expand Down Expand Up @@ -160,6 +174,14 @@ static ssize_t eisa_show_state (struct device *dev, struct device_attribute *att

static DEVICE_ATTR(enabled, S_IRUGO, eisa_show_state, NULL);

static ssize_t eisa_show_modalias (struct device *dev, struct device_attribute *attr, char *buf)
{
struct eisa_device *edev = to_eisa_device (dev);
return sprintf (buf, EISA_DEVICE_MODALIAS_FMT "\n", edev->id.sig);
}

static DEVICE_ATTR(modalias, S_IRUGO, eisa_show_modalias, NULL);

static int __init eisa_init_device (struct eisa_root_device *root,
struct eisa_device *edev,
int slot)
Expand Down Expand Up @@ -209,6 +231,7 @@ static int __init eisa_register_device (struct eisa_device *edev)

device_create_file (&edev->dev, &dev_attr_signature);
device_create_file (&edev->dev, &dev_attr_enabled);
device_create_file (&edev->dev, &dev_attr_modalias);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ static struct eisa_device_id el3_eisa_ids[] = {
{ "TCM5095" },
{ "" }
};
MODULE_DEVICE_TABLE(eisa, el3_eisa_ids);

static int el3_eisa_probe (struct device *device);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ static struct eisa_device_id vortex_eisa_ids[] = {
{ "TCM5970", CH_3C597 },
{ "" }
};
MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);

static int vortex_eisa_probe(struct device *device);
static int vortex_eisa_remove(struct device *device);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ne3210.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ static struct eisa_device_id ne3210_ids[] = {
{ "NVL1801" },
{ "" },
};
MODULE_DEVICE_TABLE(eisa, ne3210_ids);

static struct eisa_driver ne3210_eisa_driver = {
.id_table = ne3210_ids,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/tulip/de4x5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,7 @@ static struct eisa_device_id de4x5_eisa_ids[] = {
{ "DEC4250", 0 }, /* 0 is the board name index... */
{ "" }
};
MODULE_DEVICE_TABLE(eisa, de4x5_eisa_ids);

static struct eisa_driver de4x5_eisa_driver = {
.id_table = de4x5_eisa_ids,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/aha1740.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ static struct eisa_device_id aha1740_ids[] = {
{ "ADP0400" }, /* 1744 */
{ "" }
};
MODULE_DEVICE_TABLE(eisa, aha1740_ids);

static struct eisa_driver aha1740_driver = {
.id_table = aha1740_ids,
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/aic7xxx/aic7770_osm.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ static struct eisa_device_id aic7770_ids[] = {
{ "ADP7770", 5 }, /* AIC7770 generic */
{ "" }
};

MODULE_DEVICE_TABLE(eisa, aic7770_ids);

static struct eisa_driver aic7770_driver = {
.id_table = aic7770_ids,
.driver = {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/sim710.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ static struct eisa_device_id sim710_eisa_ids[] = {
{ "HWP0C80" },
{ "" }
};
MODULE_DEVICE_TABLE(eisa, sim710_eisa_ids);

static __init int
sim710_eisa_probe(struct device *dev)
Expand Down
8 changes: 1 addition & 7 deletions trunk/include/linux/eisa.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <linux/ioport.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>

#define EISA_SIG_LEN 8
#define EISA_MAX_SLOTS 8

#define EISA_MAX_RESOURCES 4
Expand All @@ -27,12 +27,6 @@
#define EISA_CONFIG_ENABLED 1
#define EISA_CONFIG_FORCED 2

/* The EISA signature, in ASCII form, null terminated */
struct eisa_device_id {
char sig[EISA_SIG_LEN];
unsigned long driver_data;
};

/* There is not much we can say about an EISA device, apart from
* signature, slot number, and base address. dma_mask is set by
* default to parent device mask..*/
Expand Down
12 changes: 12 additions & 0 deletions trunk/include/linux/mod_devicetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,16 @@ struct input_device_id {
kernel_ulong_t driver_info;
};

/* EISA */

#define EISA_SIG_LEN 8

/* The EISA signature, in ASCII form, null terminated */
struct eisa_device_id {
char sig[EISA_SIG_LEN];
kernel_ulong_t driver_data;
};

#define EISA_DEVICE_MODALIAS_FMT "eisa:s%s"

#endif /* LINUX_MOD_DEVICETABLE_H */
12 changes: 12 additions & 0 deletions trunk/scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ static int do_input_entry(const char *filename, struct input_device_id *id,
return 1;
}

static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa,
char *alias)
{
if (eisa->sig[0])
sprintf(alias, EISA_DEVICE_MODALIAS_FMT "*", eisa->sig);
return 1;
}

/* Ignore any prefix, eg. v850 prepends _ */
static inline int sym_is(const char *symbol, const char *name)
{
Expand Down Expand Up @@ -547,6 +555,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
do_table(symval, sym->st_size,
sizeof(struct input_device_id), "input",
do_input_entry, mod);
else if (sym_is(symname, "__mod_eisa_device_table"))
do_table(symval, sym->st_size,
sizeof(struct eisa_device_id), "eisa",
do_eisa_entry, mod);
}

/* Now add out buffered information to the generated C source */
Expand Down

0 comments on commit e21f1e9

Please sign in to comment.