Commit 886b66ef2f2d4984f6c72d86a9d8a3ffe4344fa5

Authored by David Woodhouse
Committed by John W. Linville
1 parent b503c7a273

bcma: add uevent to the bus, to autoload drivers

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff

... ... @@ -15,6 +15,7 @@
15 15 static int bcma_bus_match(struct device *dev, struct device_driver *drv);
16 16 static int bcma_device_probe(struct device *dev);
17 17 static int bcma_device_remove(struct device *dev);
  18 +static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);
18 19  
19 20 static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf)
20 21 {
... ... @@ -49,6 +50,7 @@
49 50 .match = bcma_bus_match,
50 51 .probe = bcma_device_probe,
51 52 .remove = bcma_device_remove,
  53 + .uevent = bcma_device_uevent,
52 54 .dev_attrs = bcma_device_attrs,
53 55 };
54 56  
... ... @@ -225,6 +227,16 @@
225 227 adrv->remove(core);
226 228  
227 229 return 0;
  230 +}
  231 +
  232 +static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env)
  233 +{
  234 + struct bcma_device *core = container_of(dev, struct bcma_device, dev);
  235 +
  236 + return add_uevent_var(env,
  237 + "MODALIAS=bcma:m%04Xid%04Xrev%02Xcl%02X",
  238 + core->id.manuf, core->id.id,
  239 + core->id.rev, core->id.class);
228 240 }
229 241  
230 242 static int __init bcma_modinit(void)