cxl: Introduce put_cxl_root() helper
authorDave Jiang <dave.jiang@intel.com>
Fri, 5 Jan 2024 22:07:34 +0000 (15:07 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 5 Jan 2024 22:36:29 +0000 (14:36 -0800)
commit98856b2ea3065d8f60e90f423d7707f4a4706ec5
treed065faf188bed8ad96c650216521568aba1055fd
parent185c1a489f873cb71520fc089401e02dbf302dcd
cxl: Introduce put_cxl_root() helper

Add a helper function put_cxl_root() to maintain symmetry for
find_cxl_root() function instead of relying on open coding of the
put_device() in order to dereference the 'struct device' that happens via
get_device() in find_cxl_root().

Suggested-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Link: https://lore.kernel.org/r/170449245417.3779673.4566146351673989387.stgit@djiang5-mobl3
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/port.c
drivers/cxl/cxl.h