summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/init.c
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2021-07-15 21:44:18 +0300
committerVinod Koul <vkoul@kernel.org>2021-07-21 07:39:16 +0300
commit5fee6567ec387088ec965ee60c63051bbe102cac (patch)
tree0a91c0e7fd7051197b9b5e082f5e5047d69050a9 /drivers/dma/idxd/init.c
parentc05257b5600bb35a580ecdb25695efff26326d59 (diff)
downloadlinux-5fee6567ec387088ec965ee60c63051bbe102cac.tar.xz
dmaengine: idxd: add type to driver in order to allow device matching
Add an array of support device types to the idxd_device_driver definition in order to enable simple matching of device type to a given driver. The deprecated / omnibus dsa_drv driver specifies IDXD_DEV_NONE as its only role is to service legacy userspace (old accel-config) directed bind requests and route them to them the proper driver. It need not attach to a device when the bus is autoprobed. The accel-config tooling is being updated to drop its dependency on this deprecated bind scheme. Reviewed-by: Dan Willliams <dan.j.williams@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637465882.744545.17456174666211577867.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/init.c')
-rw-r--r--drivers/dma/idxd/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 5b628e6c04bf..544ff7137292 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -879,6 +879,11 @@ int __idxd_driver_register(struct idxd_device_driver *idxd_drv, struct module *o
{
struct device_driver *drv = &idxd_drv->drv;
+ if (!idxd_drv->type) {
+ pr_debug("driver type not set (%ps)\n", __builtin_return_address(0));
+ return -EINVAL;
+ }
+
drv->name = idxd_drv->name;
drv->bus = &dsa_bus_type;
drv->owner = owner;