Commit 725b4d23 authored by Robert Richter's avatar Robert Richter Committed by Wenkuan Wang
Browse files

cxl/core/regs: Rework cxl_map_pmu_regs() to use map->dev for devm

mainline inclusion
from mainline-v6.7-rc1
commit e8db0701605bccbeb8d7907ecd2e50f346a725bd
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZZ5K


CVE: NA

--------------------------------

struct cxl_register_map carries a @dev parameter for devm operations.
Simplify the function interface to use that instead of a separate @dev
argument.

Signed-off-by: default avatarTerry Bowman <terry.bowman@amd.com>
Signed-off-by: default avatarRobert Richter <rrichter@amd.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20231018171713.1883517-21-rrichter@amd.com


Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarWenkuan Wang <Wenkuan.Wang@amd.com>
parent 8131f119
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -386,10 +386,9 @@ int cxl_count_regblock(struct pci_dev *pdev, enum cxl_regloc_type type)
}
EXPORT_SYMBOL_NS_GPL(cxl_count_regblock, CXL);

int cxl_map_pmu_regs(struct pci_dev *pdev, struct cxl_pmu_regs *regs,
		     struct cxl_register_map *map)
int cxl_map_pmu_regs(struct cxl_register_map *map, struct cxl_pmu_regs *regs)
{
	struct device *dev = &pdev->dev;
	struct device *dev = map->host;
	resource_size_t phys_addr;

	phys_addr = map->resource;
+1 −2
Original line number Diff line number Diff line
@@ -286,8 +286,7 @@ int cxl_map_component_regs(const struct cxl_register_map *map,
			   unsigned long map_mask);
int cxl_map_device_regs(const struct cxl_register_map *map,
			struct cxl_device_regs *regs);
int cxl_map_pmu_regs(struct pci_dev *pdev, struct cxl_pmu_regs *regs,
		     struct cxl_register_map *map);
int cxl_map_pmu_regs(struct cxl_register_map *map, struct cxl_pmu_regs *regs);

enum cxl_regloc_type;
int cxl_count_regblock(struct pci_dev *pdev, enum cxl_regloc_type type);
+1 −1
Original line number Diff line number Diff line
@@ -892,7 +892,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
			break;
		}

		rc = cxl_map_pmu_regs(pdev, &pmu_regs, &map);
		rc = cxl_map_pmu_regs(&map, &pmu_regs);
		if (rc) {
			dev_dbg(&pdev->dev, "Could not map PMU regs\n");
			break;