Skip to content

Commit 577a676

Browse files
ming4lidavejiang
authored andcommitted
cxl/pci: Rename cxl_setup_parent_dport() and cxl_dport_map_regs()
The name of cxl_setup_parent_dport() function is not clear, the function is used to initialize AER and RAS capabilities on a dport, therefore, rename the function to cxl_dport_init_ras_reporting(), it is easier for user to understand what the function does. Besides, adjust the order of the function parameters, the subject of cxl_dport_init_ras_reporting() is a cxl dport, so a struct cxl_dport as the first parameter of the function should be better. cxl_dport_map_regs() is used to map CXL RAS capability on a cxl dport, using cxl_dport_map_ras() as the function name. Signed-off-by: Li Ming <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 91c0e9d commit 577a676

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

drivers/cxl/core/pci.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ static void cxl_dport_map_rch_aer(struct cxl_dport *dport)
787787
dport->regs.dport_aer = dport_aer;
788788
}
789789

790-
static void cxl_dport_map_regs(struct cxl_dport *dport)
790+
static void cxl_dport_map_ras(struct cxl_dport *dport)
791791
{
792792
struct cxl_register_map *map = &dport->reg_map;
793793
struct device *dev = dport->dport_dev;
@@ -831,7 +831,12 @@ static void cxl_disable_rch_root_ints(struct cxl_dport *dport)
831831
}
832832
}
833833

834-
void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
834+
/**
835+
* cxl_dport_init_ras_reporting - Setup CXL RAS report on this dport
836+
* @dport: the cxl_dport that needs to be initialized
837+
* @host: host device for devm operations
838+
*/
839+
void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
835840
{
836841
struct device *dport_dev = dport->dport_dev;
837842

@@ -843,12 +848,12 @@ void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
843848
}
844849

845850
dport->reg_map.host = host;
846-
cxl_dport_map_regs(dport);
851+
cxl_dport_map_ras(dport);
847852

848853
if (dport->rch)
849854
cxl_disable_rch_root_ints(dport);
850855
}
851-
EXPORT_SYMBOL_NS_GPL(cxl_setup_parent_dport, CXL);
856+
EXPORT_SYMBOL_NS_GPL(cxl_dport_init_ras_reporting, CXL);
852857

853858
static void cxl_handle_rdport_cor_ras(struct cxl_dev_state *cxlds,
854859
struct cxl_dport *dport)

drivers/cxl/cxl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,10 @@ struct cxl_dport *devm_cxl_add_rch_dport(struct cxl_port *port,
763763

764764
#ifdef CONFIG_PCIEAER_CXL
765765
void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport);
766+
void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host);
766767
#else
767-
static inline void cxl_setup_parent_dport(struct device *host,
768-
struct cxl_dport *dport) { }
768+
static inline void cxl_dport_init_ras_reporting(struct cxl_dport *dport,
769+
struct device *host) { }
769770
#endif
770771

771772
struct cxl_decoder *to_cxl_decoder(struct device *dev);

drivers/cxl/mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int cxl_mem_probe(struct device *dev)
166166
else
167167
endpoint_parent = &parent_port->dev;
168168

169-
cxl_setup_parent_dport(dev, dport);
169+
cxl_dport_init_ras_reporting(dport, dev);
170170

171171
scoped_guard(device, endpoint_parent) {
172172
if (!endpoint_parent->driver) {

tools/testing/cxl/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ldflags-y += --wrap=cxl_dvsec_rr_decode
1414
ldflags-y += --wrap=devm_cxl_add_rch_dport
1515
ldflags-y += --wrap=cxl_rcd_component_reg_phys
1616
ldflags-y += --wrap=cxl_endpoint_parse_cdat
17-
ldflags-y += --wrap=cxl_setup_parent_dport
17+
ldflags-y += --wrap=cxl_dport_init_ras_reporting
1818

1919
DRIVERS := ../../../drivers
2020
CXL_SRC := $(DRIVERS)/cxl

tools/testing/cxl/test/mock.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,17 @@ void __wrap_cxl_endpoint_parse_cdat(struct cxl_port *port)
299299
}
300300
EXPORT_SYMBOL_NS_GPL(__wrap_cxl_endpoint_parse_cdat, CXL);
301301

302-
void __wrap_cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
302+
void __wrap_cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
303303
{
304304
int index;
305305
struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
306306

307307
if (!ops || !ops->is_mock_port(dport->dport_dev))
308-
cxl_setup_parent_dport(host, dport);
308+
cxl_dport_init_ras_reporting(dport, host);
309309

310310
put_cxl_mock_ops(index);
311311
}
312-
EXPORT_SYMBOL_NS_GPL(__wrap_cxl_setup_parent_dport, CXL);
312+
EXPORT_SYMBOL_NS_GPL(__wrap_cxl_dport_init_ras_reporting, CXL);
313313

314314
MODULE_LICENSE("GPL v2");
315315
MODULE_IMPORT_NS(ACPI);

0 commit comments

Comments
 (0)