dmaengine: idxd: Add wq private data accessors
authorTom Zanussi <tom.zanussi@linux.intel.com>
Tue, 5 Dec 2023 21:25:21 +0000 (15:25 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 Dec 2023 09:52:53 +0000 (17:52 +0800)
Add the accessors idxd_wq_set_private() and idxd_wq_get_private()
allowing users to set and retrieve a private void * associated with an
idxd_wq.

The private data is stored in the idxd_dev.conf_dev associated with
each idxd_wq.

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>
drivers/dma/idxd/idxd.h

index ae3be5cb2ee327d015968ee3a41d9992fa3e3305..4b67181f439653366504011203588a466f460bf7 100644 (file)
@@ -618,6 +618,16 @@ static inline int idxd_wq_refcount(struct idxd_wq *wq)
        return wq->client_count;
 };
 
+static inline void idxd_wq_set_private(struct idxd_wq *wq, void *private)
+{
+       dev_set_drvdata(wq_confdev(wq), private);
+}
+
+static inline void *idxd_wq_get_private(struct idxd_wq *wq)
+{
+       return dev_get_drvdata(wq_confdev(wq));
+}
+
 /*
  * Intel IAA does not support batch processing.
  * The max batch size of device, max batch size of wq and