static int greybus_uevent(struct device *dev, struct kobj_uevent_env *env)
{
- struct gb_host_device *hd = NULL;
+ struct gb_host_device *hd;
struct gb_interface *intf = NULL;
struct gb_bundle *bundle = NULL;
struct gb_svc *svc = NULL;
hd = to_gb_host_device(dev);
} else if (is_gb_interface(dev)) {
intf = to_gb_interface(dev);
+ hd = intf->hd;
} else if (is_gb_bundle(dev)) {
bundle = to_gb_bundle(dev);
intf = bundle->intf;
+ hd = intf->hd;
} else if (is_gb_svc(dev)) {
svc = to_gb_svc(dev);
+ hd = svc->hd;
} else {
dev_WARN(dev, "uevent for unknown greybus device \"type\"!\n");
return -EINVAL;
}
+ if (add_uevent_var(env, "BUS=%u", hd->bus_id))
+ return -ENOMEM;
+
if (bundle) {
// FIXME
// add a uevent that can "load" a bundle type
return 0;
}
- // FIXME
- // "just" a module, be vague here, nothing binds to a module except
- // the greybus core, so there's not much, if anything, we need to
- // advertise.
return 0;
}
ida_init(&svc->device_id_map);
svc->state = GB_SVC_STATE_RESET;
svc->connection = connection;
+ svc->hd = hd;
connection->private = svc;
hd->svc = svc;