diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2008-11-18 21:13:53 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2010-05-17 21:37:41 +0200 |
commit | bf54a2b3c0dbf76136f00ff785bf6d8f6291311d (patch) | |
tree | 918d2a181a90454a2893c2a86640ef72b3a164f4 /drivers/zorro/zorro-driver.c | |
parent | 0b7f1a7efb38b551f5948a13d0b36e876ba536db (diff) |
m68k: amiga - Zorro bus modalias support
Add Amiga Zorro bus modalias and uevent support
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/zorro/zorro-driver.c')
-rw-r--r-- | drivers/zorro/zorro-driver.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c index 53180a37cc9..7ee2b6e7178 100644 --- a/drivers/zorro/zorro-driver.c +++ b/drivers/zorro/zorro-driver.c @@ -137,10 +137,34 @@ static int zorro_bus_match(struct device *dev, struct device_driver *drv) return 0; } +static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env) +{ +#ifdef CONFIG_HOTPLUG + struct zorro_dev *z; + + if (!dev) + return -ENODEV; + + z = to_zorro_dev(dev); + if (!z) + return -ENODEV; + + if (add_uevent_var(env, "ZORRO_ID=%08X", z->id) || + add_uevent_var(env, "ZORRO_SLOT_NAME=%s", dev_name(dev)) || + add_uevent_var(env, "ZORRO_SLOT_ADDR=%04X", z->slotaddr) || + add_uevent_var(env, "MODALIAS=" ZORRO_DEVICE_MODALIAS_FMT, z->id)) + return -ENOMEM; + + return 0; +#else /* !CONFIG_HOTPLUG */ + return -ENODEV; +#endif /* !CONFIG_HOTPLUG */ +} struct bus_type zorro_bus_type = { .name = "zorro", .match = zorro_bus_match, + .uevent = zorro_uevent, .probe = zorro_device_probe, .remove = zorro_device_remove, }; |