cxl: Add cxl_decoders_committed() helper
authorDave Jiang <dave.jiang@intel.com>
Mon, 16 Oct 2023 17:57:48 +0000 (10:57 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 28 Oct 2023 03:29:41 +0000 (20:29 -0700)
commit458ba8189cb4380aa6a6cc4d52ab067f80a64829
tree1f5220e5c47e52604cf9f81f1e7b5db7e9516b1f
parent8f61d48c83f6e3525a770e44692604595693f787
cxl: Add cxl_decoders_committed() helper

Add a helper to retrieve the number of decoders committed for the port.
Replace all the open coding of the calculation with the helper.

Link: https://lore.kernel.org/linux-cxl/651c98472dfed_ae7e729495@dwillia2-xfh.jf.intel.com.notmuch/
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jim Harris <jim.harris@samsung.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/r/169747906849.272156.1729290904857372335.stgit@djiang5-mobl3
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/hdm.c
drivers/cxl/core/mbox.c
drivers/cxl/core/memdev.c
drivers/cxl/core/port.c
drivers/cxl/cxl.h