OSDN Git Service

cxl/pci: Cleanup repeated code in cxl_probe_regs() helpers
authorDan Williams <dan.j.williams@intel.com>
Tue, 29 Nov 2022 17:48:12 +0000 (10:48 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 3 Dec 2022 21:40:16 +0000 (13:40 -0800)
commitaf2dfef854aa6afdf380e15e39d936d3b66097f1
tree64b673c97aa3bf9f04ba9487d77a133de767c72a
parentf0c4d9fc9cc9462659728d168387191387e903cc
cxl/pci: Cleanup repeated code in cxl_probe_regs() helpers

Rather then duplicating the setting of valid, length, and offset for
each type, just convey a pointer to the register map to common code.

Yes, the change in cxl_probe_component_regs() does not save
any lines of code, but it is preparation for adding another component
register type to map (RAS Capability Structure).

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/166974409293.1608150.17661353937678581423.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/regs.c