mirror of
https://github.com/torvalds/linux
synced 2024-10-07 20:05:15 +00:00
dmaengine: idxd: add external module driver support for dsa_bus_type
Add support to allow an external driver to be registered to the dsa_bus_type and also auto-loaded. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Reviewed-by: Fenghua Yu <fenghua.yu@intel.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
8517c34e87
commit
15a6110152
|
@ -67,11 +67,17 @@ static void idxd_config_bus_remove(struct device *dev)
|
|||
idxd_drv->remove(idxd_dev);
|
||||
}
|
||||
|
||||
static int idxd_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
|
||||
{
|
||||
return add_uevent_var(env, "MODALIAS=" IDXD_DEVICES_MODALIAS_FMT, 0);
|
||||
}
|
||||
|
||||
struct bus_type dsa_bus_type = {
|
||||
.name = "dsa",
|
||||
.match = idxd_config_bus_match,
|
||||
.probe = idxd_config_bus_probe,
|
||||
.remove = idxd_config_bus_remove,
|
||||
.uevent = idxd_bus_uevent,
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(dsa_bus_type);
|
||||
|
||||
|
|
|
@ -655,6 +655,9 @@ static inline int idxd_wq_driver_name_match(struct idxd_wq *wq, struct device *d
|
|||
return (strncmp(wq->driver_name, dev->driver->name, strlen(dev->driver->name)) == 0);
|
||||
}
|
||||
|
||||
#define MODULE_ALIAS_IDXD_DEVICE(type) MODULE_ALIAS("idxd:t" __stringify(type) "*")
|
||||
#define IDXD_DEVICES_MODALIAS_FMT "idxd:t%d"
|
||||
|
||||
int __must_check __idxd_driver_register(struct idxd_device_driver *idxd_drv,
|
||||
struct module *module, const char *mod_name);
|
||||
#define idxd_driver_register(driver) \
|
||||
|
|
Loading…
Reference in a new issue