Skip to contentSkip to conversation

pinctrl: baytrail: Use devm_platform_ioremap_resource()

PATCH In review Andy Shevchenko 3 participants 9 messages Jul 3, 2019 – Jul 29, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 pinctrl: baytrail: Use devm_platform_ioremap_resource()

Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pinctrl/intel/pinctrl-baytrail.c +1 -3
index bfde1c710bd9..4fc4f9658484 100644
@@ -1582,12 +1582,10 @@ static int byt_set_soc_data(struct byt_gpio *vg,
 
 	for (i = 0; i < soc_data->ncommunities; i++) {
 		struct byt_community *comm = vg->communities_copy + i;
-		struct resource *mem_rc;
 
 		*comm = vg->soc_data->communities[i];
 
-		mem_rc = platform_get_resource(vg->pdev, IORESOURCE_MEM, 0);
-		comm->reg_base = devm_ioremap_resource(&vg->pdev->dev, mem_rc);
+		comm->reg_base = devm_platform_ioremap_resource(vg->pdev, 0);
 		if (IS_ERR(comm->reg_base))
 			return PTR_ERR(comm->reg_base);
 	}
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/4 pinctrl: cherryview: Use devm_platform_ioremap_resource()

Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pinctrl/intel/pinctrl-cherryview.c +1 -3
index d0740714b3cb..6e7da421b6c9 100644
@@ -1689,7 +1689,6 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
 {
 	struct chv_pinctrl *pctrl;
 	struct acpi_device *adev;
-	struct resource *res;
 	acpi_status status;
 	int ret, irq, i;
 
@@ -1717,8 +1716,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
 	if (!pctrl->saved_pin_context)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	pctrl->regs = devm_ioremap_resource(&pdev->dev, res);
+	pctrl->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pctrl->regs))
 		return PTR_ERR(pctrl->regs);
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 3/4 pinctrl: intel: Use devm_platform_ioremap_resource()

In reply to Andy Shevchenko

Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

---
 drivers/pinctrl/intel/pinctrl-intel.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/pinctrl/intel/pinctrl-intel.c +1 -4
index 13e4d61f14a4..dc6ef88790ae 100644
@@ -1313,15 +1313,12 @@ static int intel_pinctrl_probe(struct platform_device *pdev,
 
 	for (i = 0; i < pctrl->ncommunities; i++) {
 		struct intel_community *community = &pctrl->communities[i];
-		struct resource *res;
 		void __iomem *regs;
 		u32 padbar;
 
 		*community = pctrl->soc->communities[i];
 
-		res = platform_get_resource(pdev, IORESOURCE_MEM,
-					    community->barno);
-		regs = devm_ioremap_resource(&pdev->dev, res);
+		regs = devm_platform_ioremap_resource(pdev, community->barno);
 		if (IS_ERR(regs))
 			return PTR_ERR(regs);
 
Signature · 1 line
2.20.1
#3 lore raw

PATCH 4/4 pinctrl: merrifield: Use devm_platform_ioremap_resource()

In reply to Andy Shevchenko

Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

---
 drivers/pinctrl/intel/pinctrl-merrifield.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pinctrl/intel/pinctrl-merrifield.c +1 -3
index 4b65e1296b8a..04ca8ae95df8 100644
@@ -885,7 +885,6 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
 {
 	struct mrfld_family *families;
 	struct mrfld_pinctrl *mp;
-	struct resource *mem;
 	void __iomem *regs;
 	size_t nfamilies;
 	unsigned int i;
@@ -897,8 +896,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
 	mp->dev = &pdev->dev;
 	raw_spin_lock_init(&mp->lock);
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	regs = devm_ioremap_resource(&pdev->dev, mem);
+	regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 
Signature · 1 line
2.20.1
#6 lore raw
Quoted 1 line · Andy Shevchenko

Pushed to my review and testing queue, thanks!

I take it I can get a pull request with all the Intel pinctrl changes? They all look good to me.

Yours,
Linus Walleij

#7 lore raw
Quoted 7 lines · Linus Walleij
Quoted 1 line · Andy Shevchenko

Pushed to my review and testing queue, thanks!

I take it I can get a pull request with all the Intel pinctrl changes? They all look good to me.

Yes, we are collecting them, and GPIO as well.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 7 lines · Linus Walleij
Quoted 1 line · Andy Shevchenko

Pushed to my review and testing queue, thanks!

I take it I can get a pull request with all the Intel pinctrl changes? They all look good to me.

Yes, we are collecting them, and GPIO as well.

Awesome, thanks a LOT!

Linus Walleij