Skip to contentSkip to conversation

platform/x86: intel_speed_select_if: Use devm_ioremap_resource

PATCH In review Srinivas Pandruvada 2 participants 2 messages Sep 26, 2023

Subsystems (2)
lore
Share & tools
lore

Srinivas Pandruvada

author maintainer
#0 lore raw

PATCH 1/1 platform/x86: intel_speed_select_if: Use devm_ioremap_resource

Replace devm_ioremap() with devm_ioremap_resource() by defining a resource.

No functional impact is expected.

---
This patch requires merge of series "Minor SST optimizations", particularly
platform/x86: intel_speed_select_if: Remove hardcoded map size Can be differed to 6.8 cycle.
If I repost the series after reviews, I will include as part of the series.

 .../platform/x86/intel/speed_select_if/isst_if_mmio.c    | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c +5 -4
index 13e068c77d50..3f4343147dad 100644
@@ -94,6 +94,7 @@ static int isst_if_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct isst_if_device *punit_dev;
 	struct isst_if_cmd_cb cb;
 	u32 mmio_base, pcu_base;
+	struct resource r;
 	u64 base_addr;
 	int ret;
 
@@ -118,10 +119,10 @@ static int isst_if_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	punit_dev->mmio_range = (struct isst_mmio_range *) ent->driver_data;
 
-	punit_dev->punit_mmio = devm_ioremap(&pdev->dev, base_addr,
-					     punit_dev->mmio_range[1].size);
-	if (!punit_dev->punit_mmio)
-		return -ENOMEM;
+	r = DEFINE_RES_MEM(base_addr, punit_dev->mmio_range[1].size);
+	punit_dev->punit_mmio = devm_ioremap_resource(&pdev->dev, &r);
+	if (IS_ERR(punit_dev->punit_mmio))
+		return PTR_ERR(punit_dev->punit_mmio);
 
 	mutex_init(&punit_dev->mutex);
 	pci_set_drvdata(pdev, punit_dev);
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Srinivas Pandruvada

Replace devm_ioremap() with devm_ioremap_resource() by defining a resource.

No functional impact is expected.

Resource(s) will be monitored via resource management framework. Dunno if this will affect functionality of a code.

Quoted 1 line

Andy

Quoted 1 line
Signature · 2 lines
With Best Regards,
Andy Shevchenko