All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20 ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: linux-fbdev
  Cc: kernel-janitors, linux-serial, linux-kernel, linux-tegra,
	linux-pci, linux-arm-kernel, netdev, linux-mmc

devm_request_and_ioremap has been replaced by devm_ioremap_resource, which
gives more informative error return code information.  This patch series
removes the remaining uses of devm_request_and_ioremap.

This patch series was generated using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci from the Linux kernel
source tree.  Manual modifications have been made to move associated calls
to platform_get_resource closer to the resulting call to
devm_ioremap_resource and to remove the associated error handling code.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20 ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

devm_request_and_ioremap has been replaced by devm_ioremap_resource, which
gives more informative error return code information.  This patch series
removes the remaining uses of devm_request_and_ioremap.

This patch series was generated using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci from the Linux kernel
source tree.  Manual modifications have been made to move associated calls
to platform_get_resource closer to the resulting call to
devm_ioremap_resource and to remove the associated error handling code.


^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20 ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

devm_request_and_ioremap has been replaced by devm_ioremap_resource, which
gives more informative error return code information.  This patch series
removes the remaining uses of devm_request_and_ioremap.

This patch series was generated using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci from the Linux kernel
source tree.  Manual modifications have been made to move associated calls
to platform_get_resource closer to the resulting call to
devm_ioremap_resource and to remove the associated error handling code.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The first block of modified code is followed by a call to
devm_request_mem_region for pcie->cs with no associated ioremap.  Should
ioremap be used in this case as well?

 drivers/pci/host/pci-tegra.c |   29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..db2ddc5 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,28 +1031,17 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
 		return err;
 	}
 
-	/* request and remap controller registers */
 	pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
-	if (!pads) {
-		err = -EADDRNOTAVAIL;
+	pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+	if (IS_ERR(pcie->pads)) {
+		err = PTR_ERR(pcie->pads);
 		goto poweroff;
 	}
 
 	afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
-	if (!afi) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
-	if (!pcie->pads) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
-	if (!pcie->afi) {
-		err = -EADDRNOTAVAIL;
+	pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+	if (IS_ERR(pcie->afi)) {
+		err = PTR_ERR(pcie->afi);
 		goto poweroff;
 	}
 
@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
 		rp->lanes = value;
 		rp->pcie = pcie;
 
-		rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
-		if (!rp->base)
-			return -EADDRNOTAVAIL;
+		rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+		if (IS_ERR(rp->base))
+			return PTR_ERR(rp->base);
 
 		list_add_tail(&rp->list, &pcie->ports);
 	}

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The first block of modified code is followed by a call to
devm_request_mem_region for pcie->cs with no associated ioremap.  Should
ioremap be used in this case as well?

 drivers/pci/host/pci-tegra.c |   29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..db2ddc5 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,28 +1031,17 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
 		return err;
 	}
 
-	/* request and remap controller registers */
 	pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
-	if (!pads) {
-		err = -EADDRNOTAVAIL;
+	pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+	if (IS_ERR(pcie->pads)) {
+		err = PTR_ERR(pcie->pads);
 		goto poweroff;
 	}
 
 	afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
-	if (!afi) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
-	if (!pcie->pads) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
-	if (!pcie->afi) {
-		err = -EADDRNOTAVAIL;
+	pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+	if (IS_ERR(pcie->afi)) {
+		err = PTR_ERR(pcie->afi);
 		goto poweroff;
 	}
 
@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
 		rp->lanes = value;
 		rp->pcie = pcie;
 
-		rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
-		if (!rp->base)
-			return -EADDRNOTAVAIL;
+		rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+		if (IS_ERR(rp->base))
+			return PTR_ERR(rp->base);
 
 		list_add_tail(&rp->list, &pcie->ports);
 	}


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 2/7] serial: st-asc: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: kernel-janitors, Jiri Slaby, linux-serial, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci
and various manual modifications to move associated calls to
platform_get_resource closer to the resulting call to devm_ioremap_resource
and to remove the associated error handling code.

The initialization of port->mapbase is also moved lower, to take advantage
of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/tty/serial/st-asc.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 2ff4b1b..e0ec11d 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -665,26 +665,20 @@ static int asc_init_port(struct asc_port *ascport,
 			  struct platform_device *pdev)
 {
 	struct uart_port *port = &ascport->port;
-	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	if (!res) {
-		dev_err(&pdev->dev, "Unable to get io resource\n");
-		return -ENODEV;
-	}
+	struct resource *res;
 
 	port->iotype	= UPIO_MEM;
 	port->flags	= UPF_BOOT_AUTOCONF;
 	port->ops	= &asc_uart_ops;
 	port->fifosize	= ASC_FIFO_SIZE;
 	port->dev	= &pdev->dev;
-	port->mapbase	= res->start;
 	port->irq	= platform_get_irq(pdev, 0);
 
-	port->membase = devm_request_and_ioremap(&pdev->dev, res);
-	if (!port->membase) {
-		dev_err(&pdev->dev, "Unable to request io memory\n");
-		return -ENODEV;
-	}
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	port->membase = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(port->membase))
+		return PTR_ERR(port->membase);
+	port->mapbase = res->start;
 
 	spin_lock_init(&port->lock);
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 2/7] serial: st-asc: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: kernel-janitors, Jiri Slaby, linux-serial, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci
and various manual modifications to move associated calls to
platform_get_resource closer to the resulting call to devm_ioremap_resource
and to remove the associated error handling code.

The initialization of port->mapbase is also moved lower, to take advantage
of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/tty/serial/st-asc.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 2ff4b1b..e0ec11d 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -665,26 +665,20 @@ static int asc_init_port(struct asc_port *ascport,
 			  struct platform_device *pdev)
 {
 	struct uart_port *port = &ascport->port;
-	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	if (!res) {
-		dev_err(&pdev->dev, "Unable to get io resource\n");
-		return -ENODEV;
-	}
+	struct resource *res;
 
 	port->iotype	= UPIO_MEM;
 	port->flags	= UPF_BOOT_AUTOCONF;
 	port->ops	= &asc_uart_ops;
 	port->fifosize	= ASC_FIFO_SIZE;
 	port->dev	= &pdev->dev;
-	port->mapbase	= res->start;
 	port->irq	= platform_get_irq(pdev, 0);
 
-	port->membase = devm_request_and_ioremap(&pdev->dev, res);
-	if (!port->membase) {
-		dev_err(&pdev->dev, "Unable to request io memory\n");
-		return -ENODEV;
-	}
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	port->membase = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(port->membase))
+		return PTR_ERR(port->membase);
+	port->mapbase = res->start;
 
 	spin_lock_init(&port->lock);
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
  (?)
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Will Deacon; +Cc: kernel-janitors, linux-arm-kernel, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was partly done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The error-handling code on the call to platform_get_resource was removed
manually, and the initialization of smmu->size was manually moved lower, to
take advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iommu/arm-smmu.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ebd0a4c..dd91465 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
 	smmu->dev = dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "missing base address/size\n");
-		return -ENODEV;
-	}
-
+	smmu->base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(smmu->base))
+		return PTR_ERR(smmu->base);
 	smmu->size = resource_size(res);
-	smmu->base = devm_request_and_ioremap(dev, res);
-	if (!smmu->base)
-		return -EADDRNOTAVAIL;
 
 	if (of_property_read_u32(dev->of_node, "#global-interrupts",
 				 &smmu->num_global_irqs)) {


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was partly done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The error-handling code on the call to platform_get_resource was removed
manually, and the initialization of smmu->size was manually moved lower, to
take advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iommu/arm-smmu.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ebd0a4c..dd91465 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
 	smmu->dev = dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "missing base address/size\n");
-		return -ENODEV;
-	}
-
+	smmu->base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(smmu->base))
+		return PTR_ERR(smmu->base);
 	smmu->size = resource_size(res);
-	smmu->base = devm_request_and_ioremap(dev, res);
-	if (!smmu->base)
-		return -EADDRNOTAVAIL;
 
 	if (of_property_read_u32(dev->of_node, "#global-interrupts",
 				 &smmu->num_global_irqs)) {


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was partly done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The error-handling code on the call to platform_get_resource was removed
manually, and the initialization of smmu->size was manually moved lower, to
take advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iommu/arm-smmu.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ebd0a4c..dd91465 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
 	smmu->dev = dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "missing base address/size\n");
-		return -ENODEV;
-	}
-
+	smmu->base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(smmu->base))
+		return PTR_ERR(smmu->base);
 	smmu->size = resource_size(res);
-	smmu->base = devm_request_and_ioremap(dev, res);
-	if (!smmu->base)
-		return -EADDRNOTAVAIL;
 
 	if (of_property_read_u32(dev->of_node, "#global-interrupts",
 				 &smmu->num_global_irqs)) {

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 4/7] dma: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Vinod Koul; +Cc: kernel-janitors, Dan Williams, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/dma/sh/sudmac.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index c494417..8369c6f 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -345,9 +345,8 @@ static int sudmac_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -ENODEV;
 
-	chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!chan || !irq_res)
+	if (!irq_res)
 		return -ENODEV;
 
 	err = -ENOMEM;
@@ -360,9 +359,10 @@ static int sudmac_probe(struct platform_device *pdev)
 
 	dma_dev = &su_dev->shdma_dev.dma_dev;
 
-	su_dev->chan_reg = devm_request_and_ioremap(&pdev->dev, chan);
-	if (!su_dev->chan_reg)
-		return err;
+	chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	su_dev->chan_reg = devm_ioremap_resource(&pdev->dev, chan);
+	if (IS_ERR(su_dev->chan_reg))
+		return PTR_ERR(su_dev->chan_reg);
 
 	dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 4/7] dma: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Vinod Koul; +Cc: kernel-janitors, Dan Williams, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/dma/sh/sudmac.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index c494417..8369c6f 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -345,9 +345,8 @@ static int sudmac_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -ENODEV;
 
-	chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!chan || !irq_res)
+	if (!irq_res)
 		return -ENODEV;
 
 	err = -ENOMEM;
@@ -360,9 +359,10 @@ static int sudmac_probe(struct platform_device *pdev)
 
 	dma_dev = &su_dev->shdma_dev.dma_dev;
 
-	su_dev->chan_reg = devm_request_and_ioremap(&pdev->dev, chan);
-	if (!su_dev->chan_reg)
-		return err;
+	chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	su_dev->chan_reg = devm_ioremap_resource(&pdev->dev, chan);
+	if (IS_ERR(su_dev->chan_reg))
+		return PTR_ERR(su_dev->chan_reg);
 
 	dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: netdev; +Cc: kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index b1bcd4b..89ff09e 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1747,11 +1747,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	if (!bcm_enet_shared_base[0])
 		return -ENODEV;
 
-	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
 	res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
-	if (!res_mem || !res_irq || !res_irq_rx || !res_irq_tx)
+	if (!res_irq || !res_irq_rx || !res_irq_tx)
 		return -ENODEV;
 
 	ret = 0;
@@ -1767,9 +1766,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	if (ret)
 		goto out;
 
-	priv->base = devm_request_and_ioremap(&pdev->dev, res_mem);
-	if (priv->base == NULL) {
-		ret = -ENOMEM;
+	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
+	if (IS_ERR(priv->base)) {
+		ret = PTR_ERR(priv->base);
 		goto out;
 	}
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: netdev; +Cc: kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index b1bcd4b..89ff09e 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1747,11 +1747,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	if (!bcm_enet_shared_base[0])
 		return -ENODEV;
 
-	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
 	res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
-	if (!res_mem || !res_irq || !res_irq_rx || !res_irq_tx)
+	if (!res_irq || !res_irq_rx || !res_irq_tx)
 		return -ENODEV;
 
 	ret = 0;
@@ -1767,9 +1766,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	if (ret)
 		goto out;
 
-	priv->base = devm_request_and_ioremap(&pdev->dev, res_mem);
-	if (priv->base = NULL) {
-		ret = -ENOMEM;
+	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
+	if (IS_ERR(priv->base)) {
+		ret = PTR_ERR(priv->base);
 		goto out;
 	}
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard
  Cc: kernel-janitors, Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The initialization of drvdata->regs_phys was manually moved lower, to take
advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/video/xilinxfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 6629b29..84c664e 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
 		struct resource *res;
 
 		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		drvdata->regs_phys = res->start;
-		drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
-		if (!drvdata->regs) {
-			rc = -EADDRNOTAVAIL;
+		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(drvdata->regs)) {
+			rc = PTR_ERR(drvdata->regs);
 			goto err_region;
 		}
+		drvdata->regs_phys = res->start;
 	}
 
 	/* Allocate the framebuffer memory */


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard
  Cc: kernel-janitors, Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The initialization of drvdata->regs_phys was manually moved lower, to take
advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/video/xilinxfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 6629b29..84c664e 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
 		struct resource *res;
 
 		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		drvdata->regs_phys = res->start;
-		drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
-		if (!drvdata->regs) {
-			rc = -EADDRNOTAVAIL;
+		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(drvdata->regs)) {
+			rc = PTR_ERR(drvdata->regs);
 			goto err_region;
 		}
+		drvdata->regs_phys = res->start;
 	}
 
 	/* Allocate the framebuffer memory */


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 7/7] mmc: mvsdio: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` Julia Lawall
@ 2013-08-19 11:20   ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: kernel-janitors, Chris Ball, linux-mmc, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/mvsdio.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 4ddd83f..2ac7d3a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -687,9 +687,8 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	int ret, irq;
 	struct pinctrl *pinctrl;
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irq = platform_get_irq(pdev, 0);
-	if (!r || irq < 0)
+	if (irq < 0)
 		return -ENXIO;
 
 	mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
@@ -774,9 +773,10 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
 	spin_lock_init(&host->lock);
 
-	host->base = devm_request_and_ioremap(&pdev->dev, r);
-	if (!host->base) {
-		ret = -ENOMEM;
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	host->base = devm_ioremap_resource(&pdev->dev, r);
+	if (IS_ERR(host->base)) {
+		ret = PTR_ERR(host->base);
 		goto out;
 	}
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* [PATCH 7/7] mmc: mvsdio: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20   ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: kernel-janitors, Chris Ball, linux-mmc, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/mvsdio.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 4ddd83f..2ac7d3a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -687,9 +687,8 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	int ret, irq;
 	struct pinctrl *pinctrl;
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irq = platform_get_irq(pdev, 0);
-	if (!r || irq < 0)
+	if (irq < 0)
 		return -ENXIO;
 
 	mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
@@ -774,9 +773,10 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
 	spin_lock_init(&host->lock);
 
-	host->base = devm_request_and_ioremap(&pdev->dev, r);
-	if (!host->base) {
-		ret = -ENOMEM;
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	host->base = devm_ioremap_resource(&pdev->dev, r);
+	if (IS_ERR(host->base)) {
+		ret = PTR_ERR(host->base);
 		goto out;
 	}
 


^ permalink raw reply related	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20   ` Julia Lawall
@ 2013-08-19 12:02     ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 12:02 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> The first block of modified code is followed by a call to
> devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> ioremap be used in this case as well?

No. The pcie->cs resource is 256 MiB so it's challenging to map it at
once. Furthermore it requires a non-linear mapping so we do it on
demand.

>  drivers/pci/host/pci-tegra.c |   29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)

Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>

Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
future? Do you want me to prepare a branch and pull from that or would
you rather just take simple patches?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 12:02     ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 12:02 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> The first block of modified code is followed by a call to
> devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> ioremap be used in this case as well?

No. The pcie->cs resource is 256 MiB so it's challenging to map it at
once. Furthermore it requires a non-linear mapping so we do it on
demand.

>  drivers/pci/host/pci-tegra.c |   29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)

Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>

Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
future? Do you want me to prepare a branch and pull from that or would
you rather just take simple patches?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 12:02     ` Thierry Reding
  (?)
@ 2013-08-19 12:07       ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 12:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Bjorn Helgaas,
	Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > Error-handling code was manually removed from the associated calls to
> > platform_get_resource.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> >
> > ---
> > The first block of modified code is followed by a call to
> > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > ioremap be used in this case as well?
>
> No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> once. Furthermore it requires a non-linear mapping so we do it on
> demand.

OK, thanks for the explanation.  Is the comment, though, a little
misleading, since the mapping is not done here?

/* request and remap configuration space */

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 12:07       ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 12:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > Error-handling code was manually removed from the associated calls to
> > platform_get_resource.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> > The first block of modified code is followed by a call to
> > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > ioremap be used in this case as well?
>
> No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> once. Furthermore it requires a non-linear mapping so we do it on
> demand.

OK, thanks for the explanation.  Is the comment, though, a little
misleading, since the mapping is not done here?

/* request and remap configuration space */

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 12:07       ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 12:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > Error-handling code was manually removed from the associated calls to
> > platform_get_resource.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> > The first block of modified code is followed by a call to
> > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > ioremap be used in this case as well?
>
> No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> once. Furthermore it requires a non-linear mapping so we do it on
> demand.

OK, thanks for the explanation.  Is the comment, though, a little
misleading, since the mapping is not done here?

/* request and remap configuration space */

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 12:07       ` Julia Lawall
@ 2013-08-19 12:12         ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 12:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 19 Aug 2013, Thierry Reding wrote:
> 
> > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > >
> > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > >
> > > This was done using the semantic patch
> > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > >
> > > Error-handling code was manually removed from the associated calls to
> > > platform_get_resource.
> > >
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > >
> > > ---
> > > The first block of modified code is followed by a call to
> > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > ioremap be used in this case as well?
> >
> > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > once. Furthermore it requires a non-linear mapping so we do it on
> > demand.
> 
> OK, thanks for the explanation.  Is the comment, though, a little
> misleading, since the mapping is not done here?
> 
> /* request and remap configuration space */

Yes, that's misleading. Given that it doesn't really add anything useful
information either, perhaps I should just remove it.

Thanks,
Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 12:12         ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 12:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 19 Aug 2013, Thierry Reding wrote:
> 
> > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > >
> > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > >
> > > This was done using the semantic patch
> > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > >
> > > Error-handling code was manually removed from the associated calls to
> > > platform_get_resource.
> > >
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > >
> > > ---
> > > The first block of modified code is followed by a call to
> > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > ioremap be used in this case as well?
> >
> > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > once. Furthermore it requires a non-linear mapping so we do it on
> > demand.
> 
> OK, thanks for the explanation.  Is the comment, though, a little
> misleading, since the mapping is not done here?
> 
> /* request and remap configuration space */

Yes, that's misleading. Given that it doesn't really add anything useful
information either, perhaps I should just remove it.

Thanks,
Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 12:12         ` Thierry Reding
  (?)
@ 2013-08-19 12:15           ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 12:15 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Bjorn Helgaas,
	Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> >
> >
> > On Mon, 19 Aug 2013, Thierry Reding wrote:
> >
> > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> > > >
> > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > >
> > > > This was done using the semantic patch
> > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > >
> > > > Error-handling code was manually removed from the associated calls to
> > > > platform_get_resource.
> > > >
> > > > Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> > > >
> > > > ---
> > > > The first block of modified code is followed by a call to
> > > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > > ioremap be used in this case as well?
> > >
> > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > once. Furthermore it requires a non-linear mapping so we do it on
> > > demand.
> >
> > OK, thanks for the explanation.  Is the comment, though, a little
> > misleading, since the mapping is not done here?
> >
> > /* request and remap configuration space */
>
> Yes, that's misleading. Given that it doesn't really add anything useful
> information either, perhaps I should just remove it.

OK, or maybe something like

/* request configuration space, but remap later, on demand */

To make it clear that something different is intended than the
devm_ioremap_resources that come just before..

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 12:15           ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 12:15 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> >
> >
> > On Mon, 19 Aug 2013, Thierry Reding wrote:
> >
> > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > > >
> > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > >
> > > > This was done using the semantic patch
> > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > >
> > > > Error-handling code was manually removed from the associated calls to
> > > > platform_get_resource.
> > > >
> > > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > >
> > > > ---
> > > > The first block of modified code is followed by a call to
> > > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > > ioremap be used in this case as well?
> > >
> > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > once. Furthermore it requires a non-linear mapping so we do it on
> > > demand.
> >
> > OK, thanks for the explanation.  Is the comment, though, a little
> > misleading, since the mapping is not done here?
> >
> > /* request and remap configuration space */
>
> Yes, that's misleading. Given that it doesn't really add anything useful
> information either, perhaps I should just remove it.

OK, or maybe something like

/* request configuration space, but remap later, on demand */

To make it clear that something different is intended than the
devm_ioremap_resources that come just before..

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 12:15           ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-19 12:15 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> >
> >
> > On Mon, 19 Aug 2013, Thierry Reding wrote:
> >
> > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > > >
> > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > >
> > > > This was done using the semantic patch
> > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > >
> > > > Error-handling code was manually removed from the associated calls to
> > > > platform_get_resource.
> > > >
> > > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > >
> > > > ---
> > > > The first block of modified code is followed by a call to
> > > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > > ioremap be used in this case as well?
> > >
> > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > once. Furthermore it requires a non-linear mapping so we do it on
> > > demand.
> >
> > OK, thanks for the explanation.  Is the comment, though, a little
> > misleading, since the mapping is not done here?
> >
> > /* request and remap configuration space */
>
> Yes, that's misleading. Given that it doesn't really add anything useful
> information either, perhaps I should just remove it.

OK, or maybe something like

/* request configuration space, but remap later, on demand */

To make it clear that something different is intended than the
devm_ioremap_resources that come just before..

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 12:15           ` Julia Lawall
  (?)
@ 2013-08-19 19:33             ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 19:33 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Bjorn Helgaas,
	Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]

On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 19 Aug 2013, Thierry Reding wrote:
> 
> > On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Mon, 19 Aug 2013, Thierry Reding wrote:
> > >
> > > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > > From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> > > > >
> > > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > > >
> > > > > This was done using the semantic patch
> > > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > > >
> > > > > Error-handling code was manually removed from the associated calls to
> > > > > platform_get_resource.
> > > > >
> > > > > Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> > > > >
> > > > > ---
> > > > > The first block of modified code is followed by a call to
> > > > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > > > ioremap be used in this case as well?
> > > >
> > > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > > once. Furthermore it requires a non-linear mapping so we do it on
> > > > demand.
> > >
> > > OK, thanks for the explanation.  Is the comment, though, a little
> > > misleading, since the mapping is not done here?
> > >
> > > /* request and remap configuration space */
> >
> > Yes, that's misleading. Given that it doesn't really add anything useful
> > information either, perhaps I should just remove it.
> 
> OK, or maybe something like
> 
> /* request configuration space, but remap later, on demand */
> 
> To make it clear that something different is intended than the
> devm_ioremap_resources that come just before..

Yes, that works for me too. Can you respin the patch with the comment
updated and my Acked-by and Tested-by so Bjorn can pick it up?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 19:33             ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 19:33 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 19 Aug 2013, Thierry Reding wrote:
> 
> > On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Mon, 19 Aug 2013, Thierry Reding wrote:
> > >
> > > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > > > >
> > > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > > >
> > > > > This was done using the semantic patch
> > > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > > >
> > > > > Error-handling code was manually removed from the associated calls to
> > > > > platform_get_resource.
> > > > >
> > > > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > > >
> > > > > ---
> > > > > The first block of modified code is followed by a call to
> > > > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > > > ioremap be used in this case as well?
> > > >
> > > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > > once. Furthermore it requires a non-linear mapping so we do it on
> > > > demand.
> > >
> > > OK, thanks for the explanation.  Is the comment, though, a little
> > > misleading, since the mapping is not done here?
> > >
> > > /* request and remap configuration space */
> >
> > Yes, that's misleading. Given that it doesn't really add anything useful
> > information either, perhaps I should just remove it.
> 
> OK, or maybe something like
> 
> /* request configuration space, but remap later, on demand */
> 
> To make it clear that something different is intended than the
> devm_ioremap_resources that come just before..

Yes, that works for me too. Can you respin the patch with the comment
updated and my Acked-by and Tested-by so Bjorn can pick it up?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 19:33             ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 19:33 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 19 Aug 2013, Thierry Reding wrote:
> 
> > On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Mon, 19 Aug 2013, Thierry Reding wrote:
> > >
> > > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > > > >
> > > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > > >
> > > > > This was done using the semantic patch
> > > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > > >
> > > > > Error-handling code was manually removed from the associated calls to
> > > > > platform_get_resource.
> > > > >
> > > > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > > >
> > > > > ---
> > > > > The first block of modified code is followed by a call to
> > > > > devm_request_mem_region for pcie->cs with no associated ioremap.  Should
> > > > > ioremap be used in this case as well?
> > > >
> > > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > > once. Furthermore it requires a non-linear mapping so we do it on
> > > > demand.
> > >
> > > OK, thanks for the explanation.  Is the comment, though, a little
> > > misleading, since the mapping is not done here?
> > >
> > > /* request and remap configuration space */
> >
> > Yes, that's misleading. Given that it doesn't really add anything useful
> > information either, perhaps I should just remove it.
> 
> OK, or maybe something like
> 
> /* request configuration space, but remap later, on demand */
> 
> To make it clear that something different is intended than the
> devm_ioremap_resources that come just before..

Yes, that works for me too. Can you respin the patch with the comment
updated and my Acked-by and Tested-by so Bjorn can pick it up?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 12:02     ` Thierry Reding
@ 2013-08-19 20:04       ` Bjorn Helgaas
  -1 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-19 20:04 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> future? Do you want me to prepare a branch and pull from that or would
> you rather just take simple patches?

I'm in the habit of applying patches from email, so that's easy for
me.  But a branch would be OK, too.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 20:04       ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-19 20:04 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> future? Do you want me to prepare a branch and pull from that or would
> you rather just take simple patches?

I'm in the habit of applying patches from email, so that's easy for
me.  But a branch would be OK, too.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 20:04       ` Bjorn Helgaas
@ 2013-08-19 20:12         ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 20:12 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> 
> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> > future? Do you want me to prepare a branch and pull from that or would
> > you rather just take simple patches?
> 
> I'm in the habit of applying patches from email, so that's easy for
> me.  But a branch would be OK, too.

Patches work for me too. Is this cleanup patch something that you'd be
comfortable with applying after 3.12-rc1 or would you rather defer it to
3.13?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 20:12         ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-19 20:12 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> 
> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> > future? Do you want me to prepare a branch and pull from that or would
> > you rather just take simple patches?
> 
> I'm in the habit of applying patches from email, so that's easy for
> me.  But a branch would be OK, too.

Patches work for me too. Is this cleanup patch something that you'd be
comfortable with applying after 3.12-rc1 or would you rather defer it to
3.13?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 20:12         ` Thierry Reding
  (?)
@ 2013-08-19 20:49           ` Bjorn Helgaas
  -1 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-19 20:49 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
>> > future? Do you want me to prepare a branch and pull from that or would
>> > you rather just take simple patches?
>>
>> I'm in the habit of applying patches from email, so that's easy for
>> me.  But a branch would be OK, too.
>
> Patches work for me too. Is this cleanup patch something that you'd be
> comfortable with applying after 3.12-rc1 or would you rather defer it to
> 3.13?

I'm not really sure how we should manage drivers/pci/host/*.  Those
files are mostly arch code, and I'm not sure it's useful for me to be
in the middle of managing them.

I assume Stephen or somebody has a tree with the pci-tegra.c stuff
that's in -next right now; it seems like it'd be simplest to just add
this patch there and merge in during the v3.12 merge window.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 20:49           ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-19 20:49 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>> <thierry.reding@gmail.com> wrote:
>>
>> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
>> > future? Do you want me to prepare a branch and pull from that or would
>> > you rather just take simple patches?
>>
>> I'm in the habit of applying patches from email, so that's easy for
>> me.  But a branch would be OK, too.
>
> Patches work for me too. Is this cleanup patch something that you'd be
> comfortable with applying after 3.12-rc1 or would you rather defer it to
> 3.13?

I'm not really sure how we should manage drivers/pci/host/*.  Those
files are mostly arch code, and I'm not sure it's useful for me to be
in the middle of managing them.

I assume Stephen or somebody has a tree with the pci-tegra.c stuff
that's in -next right now; it seems like it'd be simplest to just add
this patch there and merge in during the v3.12 merge window.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 20:49           ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-19 20:49 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>> <thierry.reding@gmail.com> wrote:
>>
>> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
>> > future? Do you want me to prepare a branch and pull from that or would
>> > you rather just take simple patches?
>>
>> I'm in the habit of applying patches from email, so that's easy for
>> me.  But a branch would be OK, too.
>
> Patches work for me too. Is this cleanup patch something that you'd be
> comfortable with applying after 3.12-rc1 or would you rather defer it to
> 3.13?

I'm not really sure how we should manage drivers/pci/host/*.  Those
files are mostly arch code, and I'm not sure it's useful for me to be
in the middle of managing them.

I assume Stephen or somebody has a tree with the pci-tegra.c stuff
that's in -next right now; it seems like it'd be simplest to just add
this patch there and merge in during the v3.12 merge window.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 19:33             ` Thierry Reding
  (?)
@ 2013-08-19 20:56               ` Stephen Warren
  -1 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-19 20:56 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	Bjorn Helgaas, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 08/19/2013 01:33 PM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
>> 
>> 
>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>> 
>>> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
>>>> 
>>>> 
>>>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>>>> 
>>>>> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall
>>>>> wrote:
>>>>>> From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
>>>>>> 
>>>>>> Use devm_ioremap_resource instead of
>>>>>> devm_request_and_ioremap.
>>>>>> 
>>>>>> This was done using the semantic patch 
>>>>>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>>>>> 
>>>>>> Error-handling code was manually removed from the
>>>>>> associated calls to platform_get_resource.
>>>>>> 
>>>>>> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
>>>>>> 
>>>>>> --- The first block of modified code is followed by a
>>>>>> call to devm_request_mem_region for pcie->cs with no
>>>>>> associated ioremap.  Should ioremap be used in this case
>>>>>> as well?
>>>>> 
>>>>> No. The pcie->cs resource is 256 MiB so it's challenging to
>>>>> map it at once. Furthermore it requires a non-linear
>>>>> mapping so we do it on demand.
>>>> 
>>>> OK, thanks for the explanation.  Is the comment, though, a
>>>> little misleading, since the mapping is not done here?
>>>> 
>>>> /* request and remap configuration space */
>>> 
>>> Yes, that's misleading. Given that it doesn't really add
>>> anything useful information either, perhaps I should just
>>> remove it.
>> 
>> OK, or maybe something like
>> 
>> /* request configuration space, but remap later, on demand */
>> 
>> To make it clear that something different is intended than the 
>> devm_ioremap_resources that come just before..
> 
> Yes, that works for me too. Can you respin the patch with the
> comment updated and my Acked-by and Tested-by so Bjorn can pick it
> up?

Just a note though: Since the Tegra PCIe driver is only being added in
v3.12-rc1, and that add is happening in the Tegra/arm-soc tree, Bjorn
won't be able to accept the patch until after v3.12-rc1. Perhaps the
arm-soc tree could take the patch before then though...

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 20:56               ` Stephen Warren
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-19 20:56 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Bjorn Helgaas, linux-tegra,
	linux-pci, linux-kernel

On 08/19/2013 01:33 PM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
>> 
>> 
>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>> 
>>> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
>>>> 
>>>> 
>>>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>>>> 
>>>>> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall
>>>>> wrote:
>>>>>> From: Julia Lawall <Julia.Lawall@lip6.fr>
>>>>>> 
>>>>>> Use devm_ioremap_resource instead of
>>>>>> devm_request_and_ioremap.
>>>>>> 
>>>>>> This was done using the semantic patch 
>>>>>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>>>>> 
>>>>>> Error-handling code was manually removed from the
>>>>>> associated calls to platform_get_resource.
>>>>>> 
>>>>>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>>>>>> 
>>>>>> --- The first block of modified code is followed by a
>>>>>> call to devm_request_mem_region for pcie->cs with no
>>>>>> associated ioremap.  Should ioremap be used in this case
>>>>>> as well?
>>>>> 
>>>>> No. The pcie->cs resource is 256 MiB so it's challenging to
>>>>> map it at once. Furthermore it requires a non-linear
>>>>> mapping so we do it on demand.
>>>> 
>>>> OK, thanks for the explanation.  Is the comment, though, a
>>>> little misleading, since the mapping is not done here?
>>>> 
>>>> /* request and remap configuration space */
>>> 
>>> Yes, that's misleading. Given that it doesn't really add
>>> anything useful information either, perhaps I should just
>>> remove it.
>> 
>> OK, or maybe something like
>> 
>> /* request configuration space, but remap later, on demand */
>> 
>> To make it clear that something different is intended than the 
>> devm_ioremap_resources that come just before..
> 
> Yes, that works for me too. Can you respin the patch with the
> comment updated and my Acked-by and Tested-by so Bjorn can pick it
> up?

Just a note though: Since the Tegra PCIe driver is only being added in
v3.12-rc1, and that add is happening in the Tegra/arm-soc tree, Bjorn
won't be able to accept the patch until after v3.12-rc1. Perhaps the
arm-soc tree could take the patch before then though...


^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 20:56               ` Stephen Warren
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-19 20:56 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Bjorn Helgaas, linux-tegra,
	linux-pci, linux-kernel

On 08/19/2013 01:33 PM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
>> 
>> 
>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>> 
>>> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
>>>> 
>>>> 
>>>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>>>> 
>>>>> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall
>>>>> wrote:
>>>>>> From: Julia Lawall <Julia.Lawall@lip6.fr>
>>>>>> 
>>>>>> Use devm_ioremap_resource instead of
>>>>>> devm_request_and_ioremap.
>>>>>> 
>>>>>> This was done using the semantic patch 
>>>>>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>>>>> 
>>>>>> Error-handling code was manually removed from the
>>>>>> associated calls to platform_get_resource.
>>>>>> 
>>>>>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>>>>>> 
>>>>>> --- The first block of modified code is followed by a
>>>>>> call to devm_request_mem_region for pcie->cs with no
>>>>>> associated ioremap.  Should ioremap be used in this case
>>>>>> as well?
>>>>> 
>>>>> No. The pcie->cs resource is 256 MiB so it's challenging to
>>>>> map it at once. Furthermore it requires a non-linear
>>>>> mapping so we do it on demand.
>>>> 
>>>> OK, thanks for the explanation.  Is the comment, though, a
>>>> little misleading, since the mapping is not done here?
>>>> 
>>>> /* request and remap configuration space */
>>> 
>>> Yes, that's misleading. Given that it doesn't really add
>>> anything useful information either, perhaps I should just
>>> remove it.
>> 
>> OK, or maybe something like
>> 
>> /* request configuration space, but remap later, on demand */
>> 
>> To make it clear that something different is intended than the 
>> devm_ioremap_resources that come just before..
> 
> Yes, that works for me too. Can you respin the patch with the
> comment updated and my Acked-by and Tested-by so Bjorn can pick it
> up?

Just a note though: Since the Tegra PCIe driver is only being added in
v3.12-rc1, and that add is happening in the Tegra/arm-soc tree, Bjorn
won't be able to accept the patch until after v3.12-rc1. Perhaps the
arm-soc tree could take the patch before then though...


^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 19:33             ` Thierry Reding
  (?)
@ 2013-08-20  9:13               ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-20  9:13 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	Bjorn Helgaas, Stephen Warren,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Adjust the comment at the third platform_get_resource_byname to make clear
why ioremap is not done at this point.

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
Acked-by: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Tested-by: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

---
v2: add the change to the comment

 drivers/pci/host/pci-tegra.c |   31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..2e9888a 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
 		return err;
 	}

-	/* request and remap controller registers */
 	pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
-	if (!pads) {
-		err = -EADDRNOTAVAIL;
+	pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+	if (IS_ERR(pcie->pads)) {
+		err = PTR_ERR(pcie->pads);
 		goto poweroff;
 	}

 	afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
-	if (!afi) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
-	if (!pcie->pads) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
-	if (!pcie->afi) {
-		err = -EADDRNOTAVAIL;
+	pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+	if (IS_ERR(pcie->afi)) {
+		err = PTR_ERR(pcie->afi);
 		goto poweroff;
 	}

-	/* request and remap configuration space */
+	/* request configuration space, but remap later, on demand */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
 	if (!res) {
 		err = -EADDRNOTAVAIL;
@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
 		rp->lanes = value;
 		rp->pcie = pcie;

-		rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
-		if (!rp->base)
-			return -EADDRNOTAVAIL;
+		rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+		if (IS_ERR(rp->base))
+			return PTR_ERR(rp->base);

 		list_add_tail(&rp->list, &pcie->ports);
 	}

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20  9:13               ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-20  9:13 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Bjorn Helgaas, Stephen Warren,
	linux-tegra, linux-pci, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Adjust the comment at the third platform_get_resource_byname to make clear
why ioremap is not done at this point.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: Thierry Reding <thierry.reding@gmail.com>

---
v2: add the change to the comment

 drivers/pci/host/pci-tegra.c |   31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..2e9888a 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
 		return err;
 	}

-	/* request and remap controller registers */
 	pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
-	if (!pads) {
-		err = -EADDRNOTAVAIL;
+	pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+	if (IS_ERR(pcie->pads)) {
+		err = PTR_ERR(pcie->pads);
 		goto poweroff;
 	}

 	afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
-	if (!afi) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
-	if (!pcie->pads) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
-	if (!pcie->afi) {
-		err = -EADDRNOTAVAIL;
+	pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+	if (IS_ERR(pcie->afi)) {
+		err = PTR_ERR(pcie->afi);
 		goto poweroff;
 	}

-	/* request and remap configuration space */
+	/* request configuration space, but remap later, on demand */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
 	if (!res) {
 		err = -EADDRNOTAVAIL;
@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
 		rp->lanes = value;
 		rp->pcie = pcie;

-		rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
-		if (!rp->base)
-			return -EADDRNOTAVAIL;
+		rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+		if (IS_ERR(rp->base))
+			return PTR_ERR(rp->base);

 		list_add_tail(&rp->list, &pcie->ports);
 	}

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20  9:13               ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-20  9:13 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Julia Lawall, kernel-janitors, Bjorn Helgaas, Stephen Warren,
	linux-tegra, linux-pci, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Adjust the comment at the third platform_get_resource_byname to make clear
why ioremap is not done at this point.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: Thierry Reding <thierry.reding@gmail.com>

---
v2: add the change to the comment

 drivers/pci/host/pci-tegra.c |   31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..2e9888a 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
 		return err;
 	}

-	/* request and remap controller registers */
 	pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
-	if (!pads) {
-		err = -EADDRNOTAVAIL;
+	pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+	if (IS_ERR(pcie->pads)) {
+		err = PTR_ERR(pcie->pads);
 		goto poweroff;
 	}

 	afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
-	if (!afi) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
-	if (!pcie->pads) {
-		err = -EADDRNOTAVAIL;
-		goto poweroff;
-	}
-
-	pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
-	if (!pcie->afi) {
-		err = -EADDRNOTAVAIL;
+	pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+	if (IS_ERR(pcie->afi)) {
+		err = PTR_ERR(pcie->afi);
 		goto poweroff;
 	}

-	/* request and remap configuration space */
+	/* request configuration space, but remap later, on demand */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
 	if (!res) {
 		err = -EADDRNOTAVAIL;
@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
 		rp->lanes = value;
 		rp->pcie = pcie;

-		rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
-		if (!rp->base)
-			return -EADDRNOTAVAIL;
+		rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+		if (IS_ERR(rp->base))
+			return PTR_ERR(rp->base);

 		list_add_tail(&rp->list, &pcie->ports);
 	}

^ permalink raw reply related	[flat|nested] 80+ messages in thread

* Re: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20   ` Julia Lawall
  (?)
@ 2013-08-20 11:35     ` Will Deacon
  -1 siblings, 0 replies; 80+ messages in thread
From: Will Deacon @ 2013-08-20 11:35 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-arm-kernel, linux-kernel

Hi Julia,

On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was partly done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The error-handling code on the call to platform_get_resource was removed
> manually, and the initialization of smmu->size was manually moved lower, to
> take advantage of the NULL test on res performed by devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/iommu/arm-smmu.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index ebd0a4c..dd91465 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
>  	smmu->dev = dev;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(dev, "missing base address/size\n");
> -		return -ENODEV;
> -	}
> -
> +	smmu->base = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(smmu->base))
> +		return PTR_ERR(smmu->base);
>  	smmu->size = resource_size(res);
> -	smmu->base = devm_request_and_ioremap(dev, res);
> -	if (!smmu->base)
> -		return -EADDRNOTAVAIL;

This does mean we trade arguably more useful error codes for the catch-all
-EINVAL, but the code ends up looking neater so I can be swayed either way.

Is this part of a series you're dealing with, or would you like me to take
this (I already sent my SMMU patches for 3.12)?

Cheers,

Will

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 11:35     ` Will Deacon
  0 siblings, 0 replies; 80+ messages in thread
From: Will Deacon @ 2013-08-20 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,

On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was partly done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The error-handling code on the call to platform_get_resource was removed
> manually, and the initialization of smmu->size was manually moved lower, to
> take advantage of the NULL test on res performed by devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/iommu/arm-smmu.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index ebd0a4c..dd91465 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
>  	smmu->dev = dev;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(dev, "missing base address/size\n");
> -		return -ENODEV;
> -	}
> -
> +	smmu->base = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(smmu->base))
> +		return PTR_ERR(smmu->base);
>  	smmu->size = resource_size(res);
> -	smmu->base = devm_request_and_ioremap(dev, res);
> -	if (!smmu->base)
> -		return -EADDRNOTAVAIL;

This does mean we trade arguably more useful error codes for the catch-all
-EINVAL, but the code ends up looking neater so I can be swayed either way.

Is this part of a series you're dealing with, or would you like me to take
this (I already sent my SMMU patches for 3.12)?

Cheers,

Will

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 11:35     ` Will Deacon
  0 siblings, 0 replies; 80+ messages in thread
From: Will Deacon @ 2013-08-20 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,

On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was partly done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The error-handling code on the call to platform_get_resource was removed
> manually, and the initialization of smmu->size was manually moved lower, to
> take advantage of the NULL test on res performed by devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/iommu/arm-smmu.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index ebd0a4c..dd91465 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
>  	smmu->dev = dev;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(dev, "missing base address/size\n");
> -		return -ENODEV;
> -	}
> -
> +	smmu->base = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(smmu->base))
> +		return PTR_ERR(smmu->base);
>  	smmu->size = resource_size(res);
> -	smmu->base = devm_request_and_ioremap(dev, res);
> -	if (!smmu->base)
> -		return -EADDRNOTAVAIL;

This does mean we trade arguably more useful error codes for the catch-all
-EINVAL, but the code ends up looking neater so I can be swayed either way.

Is this part of a series you're dealing with, or would you like me to take
this (I already sent my SMMU patches for 3.12)?

Cheers,

Will

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-20 11:35     ` Will Deacon
  (?)
@ 2013-08-20 11:49       ` Julia Lawall
  -1 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-20 11:49 UTC (permalink / raw)
  To: Will Deacon; +Cc: kernel-janitors, linux-arm-kernel, linux-kernel



On Tue, 20 Aug 2013, Will Deacon wrote:

> Hi Julia,
>
> On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was partly done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > The error-handling code on the call to platform_get_resource was removed
> > manually, and the initialization of smmu->size was manually moved lower, to
> > take advantage of the NULL test on res performed by devm_ioremap_resource.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> >  drivers/iommu/arm-smmu.c |   11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> > index ebd0a4c..dd91465 100644
> > --- a/drivers/iommu/arm-smmu.c
> > +++ b/drivers/iommu/arm-smmu.c
> > @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
> >  	smmu->dev = dev;
> >
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -	if (!res) {
> > -		dev_err(dev, "missing base address/size\n");
> > -		return -ENODEV;
> > -	}
> > -
> > +	smmu->base = devm_ioremap_resource(dev, res);
> > +	if (IS_ERR(smmu->base))
> > +		return PTR_ERR(smmu->base);
> >  	smmu->size = resource_size(res);
> > -	smmu->base = devm_request_and_ioremap(dev, res);
> > -	if (!smmu->base)
> > -		return -EADDRNOTAVAIL;
>
> This does mean we trade arguably more useful error codes for the catch-all
> -EINVAL, but the code ends up looking neater so I can be swayed either way.
>
> Is this part of a series you're dealing with, or would you like me to take
> this (I already sent my SMMU patches for 3.12)?

Please take it onwards.  Thanks.

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 11:49       ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-20 11:49 UTC (permalink / raw)
  To: linux-arm-kernel



On Tue, 20 Aug 2013, Will Deacon wrote:

> Hi Julia,
>
> On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was partly done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > The error-handling code on the call to platform_get_resource was removed
> > manually, and the initialization of smmu->size was manually moved lower, to
> > take advantage of the NULL test on res performed by devm_ioremap_resource.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> >  drivers/iommu/arm-smmu.c |   11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> > index ebd0a4c..dd91465 100644
> > --- a/drivers/iommu/arm-smmu.c
> > +++ b/drivers/iommu/arm-smmu.c
> > @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
> >  	smmu->dev = dev;
> >
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -	if (!res) {
> > -		dev_err(dev, "missing base address/size\n");
> > -		return -ENODEV;
> > -	}
> > -
> > +	smmu->base = devm_ioremap_resource(dev, res);
> > +	if (IS_ERR(smmu->base))
> > +		return PTR_ERR(smmu->base);
> >  	smmu->size = resource_size(res);
> > -	smmu->base = devm_request_and_ioremap(dev, res);
> > -	if (!smmu->base)
> > -		return -EADDRNOTAVAIL;
>
> This does mean we trade arguably more useful error codes for the catch-all
> -EINVAL, but the code ends up looking neater so I can be swayed either way.
>
> Is this part of a series you're dealing with, or would you like me to take
> this (I already sent my SMMU patches for 3.12)?

Please take it onwards.  Thanks.

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 11:49       ` Julia Lawall
  0 siblings, 0 replies; 80+ messages in thread
From: Julia Lawall @ 2013-08-20 11:49 UTC (permalink / raw)
  To: linux-arm-kernel



On Tue, 20 Aug 2013, Will Deacon wrote:

> Hi Julia,
>
> On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was partly done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > The error-handling code on the call to platform_get_resource was removed
> > manually, and the initialization of smmu->size was manually moved lower, to
> > take advantage of the NULL test on res performed by devm_ioremap_resource.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> >  drivers/iommu/arm-smmu.c |   11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> > index ebd0a4c..dd91465 100644
> > --- a/drivers/iommu/arm-smmu.c
> > +++ b/drivers/iommu/arm-smmu.c
> > @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
> >  	smmu->dev = dev;
> >
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -	if (!res) {
> > -		dev_err(dev, "missing base address/size\n");
> > -		return -ENODEV;
> > -	}
> > -
> > +	smmu->base = devm_ioremap_resource(dev, res);
> > +	if (IS_ERR(smmu->base))
> > +		return PTR_ERR(smmu->base);
> >  	smmu->size = resource_size(res);
> > -	smmu->base = devm_request_and_ioremap(dev, res);
> > -	if (!smmu->base)
> > -		return -EADDRNOTAVAIL;
>
> This does mean we trade arguably more useful error codes for the catch-all
> -EINVAL, but the code ends up looking neater so I can be swayed either way.
>
> Is this part of a series you're dealing with, or would you like me to take
> this (I already sent my SMMU patches for 3.12)?

Please take it onwards.  Thanks.

julia

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-20  9:13               ` Julia Lawall
  (?)
@ 2013-08-20 16:26                 ` Bjorn Helgaas
  -1 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-20 16:26 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thierry Reding, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org> wrote:
> From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
>
> Adjust the comment at the third platform_get_resource_byname to make clear
> why ioremap is not done at this point.
>
> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> Acked-by: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Tested-by: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

I'm hoping this goes via arm-soc.  Let me know if you need me to do
something.  If you need it:

Acked-by: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

> ---
> v2: add the change to the comment
>
>  drivers/pci/host/pci-tegra.c |   31 ++++++++++---------------------
>  1 file changed, 10 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 7356741..2e9888a 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
>                 return err;
>         }
>
> -       /* request and remap controller registers */
>         pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
> -       if (!pads) {
> -               err = -EADDRNOTAVAIL;
> +       pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
> +       if (IS_ERR(pcie->pads)) {
> +               err = PTR_ERR(pcie->pads);
>                 goto poweroff;
>         }
>
>         afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
> -       if (!afi) {
> -               err = -EADDRNOTAVAIL;
> -               goto poweroff;
> -       }
> -
> -       pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
> -       if (!pcie->pads) {
> -               err = -EADDRNOTAVAIL;
> -               goto poweroff;
> -       }
> -
> -       pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
> -       if (!pcie->afi) {
> -               err = -EADDRNOTAVAIL;
> +       pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
> +       if (IS_ERR(pcie->afi)) {
> +               err = PTR_ERR(pcie->afi);
>                 goto poweroff;
>         }
>
> -       /* request and remap configuration space */
> +       /* request configuration space, but remap later, on demand */
>         res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
>         if (!res) {
>                 err = -EADDRNOTAVAIL;
> @@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
>                 rp->lanes = value;
>                 rp->pcie = pcie;
>
> -               rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
> -               if (!rp->base)
> -                       return -EADDRNOTAVAIL;
> +               rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
> +               if (IS_ERR(rp->base))
> +                       return PTR_ERR(rp->base);
>
>                 list_add_tail(&rp->list, &pcie->ports);
>         }

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 16:26                 ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-20 16:26 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thierry Reding, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
>
> Adjust the comment at the third platform_get_resource_byname to make clear
> why ioremap is not done at this point.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> Acked-by: Thierry Reding <thierry.reding@gmail.com>
> Tested-by: Thierry Reding <thierry.reding@gmail.com>

I'm hoping this goes via arm-soc.  Let me know if you need me to do
something.  If you need it:

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
> v2: add the change to the comment
>
>  drivers/pci/host/pci-tegra.c |   31 ++++++++++---------------------
>  1 file changed, 10 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 7356741..2e9888a 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
>                 return err;
>         }
>
> -       /* request and remap controller registers */
>         pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
> -       if (!pads) {
> -               err = -EADDRNOTAVAIL;
> +       pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
> +       if (IS_ERR(pcie->pads)) {
> +               err = PTR_ERR(pcie->pads);
>                 goto poweroff;
>         }
>
>         afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
> -       if (!afi) {
> -               err = -EADDRNOTAVAIL;
> -               goto poweroff;
> -       }
> -
> -       pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
> -       if (!pcie->pads) {
> -               err = -EADDRNOTAVAIL;
> -               goto poweroff;
> -       }
> -
> -       pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
> -       if (!pcie->afi) {
> -               err = -EADDRNOTAVAIL;
> +       pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
> +       if (IS_ERR(pcie->afi)) {
> +               err = PTR_ERR(pcie->afi);
>                 goto poweroff;
>         }
>
> -       /* request and remap configuration space */
> +       /* request configuration space, but remap later, on demand */
>         res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
>         if (!res) {
>                 err = -EADDRNOTAVAIL;
> @@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
>                 rp->lanes = value;
>                 rp->pcie = pcie;
>
> -               rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
> -               if (!rp->base)
> -                       return -EADDRNOTAVAIL;
> +               rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
> +               if (IS_ERR(rp->base))
> +                       return PTR_ERR(rp->base);
>
>                 list_add_tail(&rp->list, &pcie->ports);
>         }

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 16:26                 ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-20 16:26 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thierry Reding, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
>
> Adjust the comment at the third platform_get_resource_byname to make clear
> why ioremap is not done at this point.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> Acked-by: Thierry Reding <thierry.reding@gmail.com>
> Tested-by: Thierry Reding <thierry.reding@gmail.com>

I'm hoping this goes via arm-soc.  Let me know if you need me to do
something.  If you need it:

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
> v2: add the change to the comment
>
>  drivers/pci/host/pci-tegra.c |   31 ++++++++++---------------------
>  1 file changed, 10 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 7356741..2e9888a 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
>                 return err;
>         }
>
> -       /* request and remap controller registers */
>         pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
> -       if (!pads) {
> -               err = -EADDRNOTAVAIL;
> +       pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
> +       if (IS_ERR(pcie->pads)) {
> +               err = PTR_ERR(pcie->pads);
>                 goto poweroff;
>         }
>
>         afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
> -       if (!afi) {
> -               err = -EADDRNOTAVAIL;
> -               goto poweroff;
> -       }
> -
> -       pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
> -       if (!pcie->pads) {
> -               err = -EADDRNOTAVAIL;
> -               goto poweroff;
> -       }
> -
> -       pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
> -       if (!pcie->afi) {
> -               err = -EADDRNOTAVAIL;
> +       pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
> +       if (IS_ERR(pcie->afi)) {
> +               err = PTR_ERR(pcie->afi);
>                 goto poweroff;
>         }
>
> -       /* request and remap configuration space */
> +       /* request configuration space, but remap later, on demand */
>         res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
>         if (!res) {
>                 err = -EADDRNOTAVAIL;
> @@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
>                 rp->lanes = value;
>                 rp->pcie = pcie;
>
> -               rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
> -               if (!rp->base)
> -                       return -EADDRNOTAVAIL;
> +               rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
> +               if (IS_ERR(rp->base))
> +                       return PTR_ERR(rp->base);
>
>                 list_add_tail(&rp->list, &pcie->ports);
>         }

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-20 16:26                 ` Bjorn Helgaas
@ 2013-08-20 18:53                   ` Stephen Warren
  -1 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-20 18:53 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Julia Lawall, Thierry Reding, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> From: Julia Lawall <Julia.Lawall@lip6.fr>
>>
>> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>>
>> This was done using the semantic patch
>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>
>> Error-handling code was manually removed from the associated calls to
>> platform_get_resource.
>>
>> Adjust the comment at the third platform_get_resource_byname to make clear
>> why ioremap is not done at this point.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>> Acked-by: Thierry Reding <thierry.reding@gmail.com>
>> Tested-by: Thierry Reding <thierry.reding@gmail.com>
> 
> I'm hoping this goes via arm-soc.  Let me know if you need me to do
> something.  If you need it:
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

In that case, Thierry, can you please bounce it to arm@kernel.org to be
applied on top of wherever Tegra's for-3.12/soc branch was merged.

Acked-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 18:53                   ` Stephen Warren
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-20 18:53 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Julia Lawall, Thierry Reding, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> From: Julia Lawall <Julia.Lawall@lip6.fr>
>>
>> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>>
>> This was done using the semantic patch
>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>
>> Error-handling code was manually removed from the associated calls to
>> platform_get_resource.
>>
>> Adjust the comment at the third platform_get_resource_byname to make clear
>> why ioremap is not done at this point.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>> Acked-by: Thierry Reding <thierry.reding@gmail.com>
>> Tested-by: Thierry Reding <thierry.reding@gmail.com>
> 
> I'm hoping this goes via arm-soc.  Let me know if you need me to do
> something.  If you need it:
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

In that case, Thierry, can you please bounce it to arm@kernel.org to be
applied on top of wherever Tegra's for-3.12/soc branch was merged.

Acked-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-20 18:53                   ` Stephen Warren
  (?)
@ 2013-08-20 19:31                       ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-20 19:31 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Bjorn Helgaas, Julia Lawall,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]

On Tue, Aug 20, 2013 at 12:53:32PM -0600, Stephen Warren wrote:
> On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> > On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org> wrote:
> >> From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> >>
> >> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >>
> >> This was done using the semantic patch
> >> scripts/coccinelle/api/devm_ioremap_resource.cocci
> >>
> >> Error-handling code was manually removed from the associated calls to
> >> platform_get_resource.
> >>
> >> Adjust the comment at the third platform_get_resource_byname to make clear
> >> why ioremap is not done at this point.
> >>
> >> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> >> Acked-by: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >> Tested-by: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 
> > I'm hoping this goes via arm-soc.  Let me know if you need me to do
> > something.  If you need it:
> > 
> > Acked-by: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> 
> In that case, Thierry, can you please bounce it to arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org to be
> applied on top of wherever Tegra's for-3.12/soc branch was merged.
> 
> Acked-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Yes, I can do that. Thanks everyone.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 19:31                       ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-20 19:31 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Bjorn Helgaas, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

On Tue, Aug 20, 2013 at 12:53:32PM -0600, Stephen Warren wrote:
> On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> > On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >> From: Julia Lawall <Julia.Lawall@lip6.fr>
> >>
> >> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >>
> >> This was done using the semantic patch
> >> scripts/coccinelle/api/devm_ioremap_resource.cocci
> >>
> >> Error-handling code was manually removed from the associated calls to
> >> platform_get_resource.
> >>
> >> Adjust the comment at the third platform_get_resource_byname to make clear
> >> why ioremap is not done at this point.
> >>
> >> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >> Acked-by: Thierry Reding <thierry.reding@gmail.com>
> >> Tested-by: Thierry Reding <thierry.reding@gmail.com>
> > 
> > I'm hoping this goes via arm-soc.  Let me know if you need me to do
> > something.  If you need it:
> > 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> In that case, Thierry, can you please bounce it to arm@kernel.org to be
> applied on top of wherever Tegra's for-3.12/soc branch was merged.
> 
> Acked-by: Stephen Warren <swarren@nvidia.com>

Yes, I can do that. Thanks everyone.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-20 19:31                       ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-20 19:31 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Bjorn Helgaas, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

On Tue, Aug 20, 2013 at 12:53:32PM -0600, Stephen Warren wrote:
> On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> > On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >> From: Julia Lawall <Julia.Lawall@lip6.fr>
> >>
> >> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >>
> >> This was done using the semantic patch
> >> scripts/coccinelle/api/devm_ioremap_resource.cocci
> >>
> >> Error-handling code was manually removed from the associated calls to
> >> platform_get_resource.
> >>
> >> Adjust the comment at the third platform_get_resource_byname to make clear
> >> why ioremap is not done at this point.
> >>
> >> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >> Acked-by: Thierry Reding <thierry.reding@gmail.com>
> >> Tested-by: Thierry Reding <thierry.reding@gmail.com>
> > 
> > I'm hoping this goes via arm-soc.  Let me know if you need me to do
> > something.  If you need it:
> > 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> In that case, Thierry, can you please bounce it to arm@kernel.org to be
> applied on top of wherever Tegra's for-3.12/soc branch was merged.
> 
> Acked-by: Stephen Warren <swarren@nvidia.com>

Yes, I can do that. Thanks everyone.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20   ` Julia Lawall
@ 2013-08-21  6:22     ` David Miller
  -1 siblings, 0 replies; 80+ messages in thread
From: David Miller @ 2013-08-21  6:22 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: netdev, kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Mon, 19 Aug 2013 13:20:39 +0200

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-21  6:22     ` David Miller
  0 siblings, 0 replies; 80+ messages in thread
From: David Miller @ 2013-08-21  6:22 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: netdev, kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Mon, 19 Aug 2013 13:20:39 +0200

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 20:49           ` Bjorn Helgaas
@ 2013-08-27  8:14             ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-27  8:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >> <thierry.reding@gmail.com> wrote:
> >>
> >> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> >> > future? Do you want me to prepare a branch and pull from that or would
> >> > you rather just take simple patches?
> >>
> >> I'm in the habit of applying patches from email, so that's easy for
> >> me.  But a branch would be OK, too.
> >
> > Patches work for me too. Is this cleanup patch something that you'd be
> > comfortable with applying after 3.12-rc1 or would you rather defer it to
> > 3.13?
> 
> I'm not really sure how we should manage drivers/pci/host/*.  Those
> files are mostly arch code, and I'm not sure it's useful for me to be
> in the middle of managing them.
> 
> I assume Stephen or somebody has a tree with the pci-tegra.c stuff
> that's in -next right now; it seems like it'd be simplest to just add
> this patch there and merge in during the v3.12 merge window.

If Stephen's fine with it I suppose we could take pci-tegra.c driver
changes through the Tegra tree. But I think it'd be good if we could
still Cc you on patches so you're aware of what we're doing (that is
the same for all drivers drivers/pci/host/*). And we're going to need
your Acked-by on the patches as well.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-27  8:14             ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-27  8:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Julia Lawall, kernel-janitors, Stephen Warren, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >> <thierry.reding@gmail.com> wrote:
> >>
> >> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> >> > future? Do you want me to prepare a branch and pull from that or would
> >> > you rather just take simple patches?
> >>
> >> I'm in the habit of applying patches from email, so that's easy for
> >> me.  But a branch would be OK, too.
> >
> > Patches work for me too. Is this cleanup patch something that you'd be
> > comfortable with applying after 3.12-rc1 or would you rather defer it to
> > 3.13?
> 
> I'm not really sure how we should manage drivers/pci/host/*.  Those
> files are mostly arch code, and I'm not sure it's useful for me to be
> in the middle of managing them.
> 
> I assume Stephen or somebody has a tree with the pci-tegra.c stuff
> that's in -next right now; it seems like it'd be simplest to just add
> this patch there and merge in during the v3.12 merge window.

If Stephen's fine with it I suppose we could take pci-tegra.c driver
changes through the Tegra tree. But I think it'd be good if we could
still Cc you on patches so you're aware of what we're doing (that is
the same for all drivers drivers/pci/host/*). And we're going to need
your Acked-by on the patches as well.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-27  8:14             ` Thierry Reding
  (?)
@ 2013-08-27 16:11               ` Stephen Warren
  -1 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-27 16:11 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Bjorn Helgaas, Julia Lawall,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 08/27/2013 02:14 AM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding 
>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding 
>>>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> 
>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>> driver in the future? Do you want me to prepare a branch
>>>>> and pull from that or would you rather just take simple
>>>>> patches?
>>>> 
>>>> I'm in the habit of applying patches from email, so that's
>>>> easy for me.  But a branch would be OK, too.
>>> 
>>> Patches work for me too. Is this cleanup patch something that
>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>> rather defer it to 3.13?
>> 
>> I'm not really sure how we should manage drivers/pci/host/*.
>> Those files are mostly arch code, and I'm not sure it's useful
>> for me to be in the middle of managing them.
>> 
>> I assume Stephen or somebody has a tree with the pci-tegra.c
>> stuff that's in -next right now; it seems like it'd be simplest
>> to just add this patch there and merge in during the v3.12 merge
>> window.
> 
> If Stephen's fine with it I suppose we could take pci-tegra.c
> driver changes through the Tegra tree. But I think it'd be good if
> we could still Cc you on patches so you're aware of what we're
> doing (that is the same for all drivers drivers/pci/host/*). And
> we're going to need your Acked-by on the patches as well.

I can push Tegra PCIe patches through the arm-soc tree before
3.12-rc1, but after that point, I think it's best if they go through
the PCIe tree, unless there's some cross-subsystem dependency for a
specific patch, and with the new PCIe driver, that's less likely.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-27 16:11               ` Stephen Warren
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-27 16:11 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Bjorn Helgaas, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On 08/27/2013 02:14 AM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding 
>> <thierry.reding@gmail.com> wrote:
>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding 
>>>> <thierry.reding@gmail.com> wrote:
>>>> 
>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>> driver in the future? Do you want me to prepare a branch
>>>>> and pull from that or would you rather just take simple
>>>>> patches?
>>>> 
>>>> I'm in the habit of applying patches from email, so that's
>>>> easy for me.  But a branch would be OK, too.
>>> 
>>> Patches work for me too. Is this cleanup patch something that
>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>> rather defer it to 3.13?
>> 
>> I'm not really sure how we should manage drivers/pci/host/*.
>> Those files are mostly arch code, and I'm not sure it's useful
>> for me to be in the middle of managing them.
>> 
>> I assume Stephen or somebody has a tree with the pci-tegra.c
>> stuff that's in -next right now; it seems like it'd be simplest
>> to just add this patch there and merge in during the v3.12 merge
>> window.
> 
> If Stephen's fine with it I suppose we could take pci-tegra.c
> driver changes through the Tegra tree. But I think it'd be good if
> we could still Cc you on patches so you're aware of what we're
> doing (that is the same for all drivers drivers/pci/host/*). And
> we're going to need your Acked-by on the patches as well.

I can push Tegra PCIe patches through the arm-soc tree before
3.12-rc1, but after that point, I think it's best if they go through
the PCIe tree, unless there's some cross-subsystem dependency for a
specific patch, and with the new PCIe driver, that's less likely.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-27 16:11               ` Stephen Warren
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Warren @ 2013-08-27 16:11 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Bjorn Helgaas, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On 08/27/2013 02:14 AM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding 
>> <thierry.reding@gmail.com> wrote:
>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding 
>>>> <thierry.reding@gmail.com> wrote:
>>>> 
>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>> driver in the future? Do you want me to prepare a branch
>>>>> and pull from that or would you rather just take simple
>>>>> patches?
>>>> 
>>>> I'm in the habit of applying patches from email, so that's
>>>> easy for me.  But a branch would be OK, too.
>>> 
>>> Patches work for me too. Is this cleanup patch something that
>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>> rather defer it to 3.13?
>> 
>> I'm not really sure how we should manage drivers/pci/host/*.
>> Those files are mostly arch code, and I'm not sure it's useful
>> for me to be in the middle of managing them.
>> 
>> I assume Stephen or somebody has a tree with the pci-tegra.c
>> stuff that's in -next right now; it seems like it'd be simplest
>> to just add this patch there and merge in during the v3.12 merge
>> window.
> 
> If Stephen's fine with it I suppose we could take pci-tegra.c
> driver changes through the Tegra tree. But I think it'd be good if
> we could still Cc you on patches so you're aware of what we're
> doing (that is the same for all drivers drivers/pci/host/*). And
> we're going to need your Acked-by on the patches as well.

I can push Tegra PCIe patches through the arm-soc tree before
3.12-rc1, but after that point, I think it's best if they go through
the PCIe tree, unless there's some cross-subsystem dependency for a
specific patch, and with the new PCIe driver, that's less likely.

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-27 16:11               ` Stephen Warren
  (?)
@ 2013-08-27 18:03                   ` Bjorn Helgaas
  -1 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-27 18:03 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Thierry Reding, Julia Lawall,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> On 08/27/2013 02:14 AM, Thierry Reding wrote:
>> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
>>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>>>>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>>
>>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>>> driver in the future? Do you want me to prepare a branch
>>>>>> and pull from that or would you rather just take simple
>>>>>> patches?
>>>>>
>>>>> I'm in the habit of applying patches from email, so that's
>>>>> easy for me.  But a branch would be OK, too.
>>>>
>>>> Patches work for me too. Is this cleanup patch something that
>>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>>> rather defer it to 3.13?
>>>
>>> I'm not really sure how we should manage drivers/pci/host/*.
>>> Those files are mostly arch code, and I'm not sure it's useful
>>> for me to be in the middle of managing them.
>>>
>>> I assume Stephen or somebody has a tree with the pci-tegra.c
>>> stuff that's in -next right now; it seems like it'd be simplest
>>> to just add this patch there and merge in during the v3.12 merge
>>> window.
>>
>> If Stephen's fine with it I suppose we could take pci-tegra.c
>> driver changes through the Tegra tree. But I think it'd be good if
>> we could still Cc you on patches so you're aware of what we're
>> doing (that is the same for all drivers drivers/pci/host/*). And
>> we're going to need your Acked-by on the patches as well.

I think you have my Acked-by for this case already (from Aug 20).  And
feel free to copy me on anything you like; my delete key works well :)

> I can push Tegra PCIe patches through the arm-soc tree before
> 3.12-rc1, but after that point, I think it's best if they go through
> the PCIe tree, unless there's some cross-subsystem dependency for a
> specific patch, and with the new PCIe driver, that's less likely.

I'm OK with merging things through my tree.  It just seemed like there
was a lot of recent Tegra activity that included a few Tegra PCI
changes, and no benefit to trying to split the PCI stuff from the
non-PCI stuff.  Hopefully it will calm down, because I don't have time
to be in the middle of major Tegra stuff.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-27 18:03                   ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-27 18:03 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Thierry Reding, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 08/27/2013 02:14 AM, Thierry Reding wrote:
>> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
>>> <thierry.reding@gmail.com> wrote:
>>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>>>>> <thierry.reding@gmail.com> wrote:
>>>>>
>>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>>> driver in the future? Do you want me to prepare a branch
>>>>>> and pull from that or would you rather just take simple
>>>>>> patches?
>>>>>
>>>>> I'm in the habit of applying patches from email, so that's
>>>>> easy for me.  But a branch would be OK, too.
>>>>
>>>> Patches work for me too. Is this cleanup patch something that
>>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>>> rather defer it to 3.13?
>>>
>>> I'm not really sure how we should manage drivers/pci/host/*.
>>> Those files are mostly arch code, and I'm not sure it's useful
>>> for me to be in the middle of managing them.
>>>
>>> I assume Stephen or somebody has a tree with the pci-tegra.c
>>> stuff that's in -next right now; it seems like it'd be simplest
>>> to just add this patch there and merge in during the v3.12 merge
>>> window.
>>
>> If Stephen's fine with it I suppose we could take pci-tegra.c
>> driver changes through the Tegra tree. But I think it'd be good if
>> we could still Cc you on patches so you're aware of what we're
>> doing (that is the same for all drivers drivers/pci/host/*). And
>> we're going to need your Acked-by on the patches as well.

I think you have my Acked-by for this case already (from Aug 20).  And
feel free to copy me on anything you like; my delete key works well :)

> I can push Tegra PCIe patches through the arm-soc tree before
> 3.12-rc1, but after that point, I think it's best if they go through
> the PCIe tree, unless there's some cross-subsystem dependency for a
> specific patch, and with the new PCIe driver, that's less likely.

I'm OK with merging things through my tree.  It just seemed like there
was a lot of recent Tegra activity that included a few Tegra PCI
changes, and no benefit to trying to split the PCI stuff from the
non-PCI stuff.  Hopefully it will calm down, because I don't have time
to be in the middle of major Tegra stuff.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-27 18:03                   ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-27 18:03 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Thierry Reding, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 08/27/2013 02:14 AM, Thierry Reding wrote:
>> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
>>> <thierry.reding@gmail.com> wrote:
>>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>>>>> <thierry.reding@gmail.com> wrote:
>>>>>
>>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>>> driver in the future? Do you want me to prepare a branch
>>>>>> and pull from that or would you rather just take simple
>>>>>> patches?
>>>>>
>>>>> I'm in the habit of applying patches from email, so that's
>>>>> easy for me.  But a branch would be OK, too.
>>>>
>>>> Patches work for me too. Is this cleanup patch something that
>>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>>> rather defer it to 3.13?
>>>
>>> I'm not really sure how we should manage drivers/pci/host/*.
>>> Those files are mostly arch code, and I'm not sure it's useful
>>> for me to be in the middle of managing them.
>>>
>>> I assume Stephen or somebody has a tree with the pci-tegra.c
>>> stuff that's in -next right now; it seems like it'd be simplest
>>> to just add this patch there and merge in during the v3.12 merge
>>> window.
>>
>> If Stephen's fine with it I suppose we could take pci-tegra.c
>> driver changes through the Tegra tree. But I think it'd be good if
>> we could still Cc you on patches so you're aware of what we're
>> doing (that is the same for all drivers drivers/pci/host/*). And
>> we're going to need your Acked-by on the patches as well.

I think you have my Acked-by for this case already (from Aug 20).  And
feel free to copy me on anything you like; my delete key works well :)

> I can push Tegra PCIe patches through the arm-soc tree before
> 3.12-rc1, but after that point, I think it's best if they go through
> the PCIe tree, unless there's some cross-subsystem dependency for a
> specific patch, and with the new PCIe driver, that's less likely.

I'm OK with merging things through my tree.  It just seemed like there
was a lot of recent Tegra activity that included a few Tegra PCI
changes, and no benefit to trying to split the PCI stuff from the
non-PCI stuff.  Hopefully it will calm down, because I don't have time
to be in the middle of major Tegra stuff.

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-27 18:03                   ` Bjorn Helgaas
@ 2013-08-28 13:02                     ` Bjorn Helgaas
  -1 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-28 13:02 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Thierry Reding, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On 08/27/2013 02:14 AM, Thierry Reding wrote:

>>> If Stephen's fine with it I suppose we could take pci-tegra.c
>>> driver changes through the Tegra tree. But I think it'd be good if
>>> we could still Cc you on patches so you're aware of what we're
>>> doing (that is the same for all drivers drivers/pci/host/*). And
>>> we're going to need your Acked-by on the patches as well.
>
> I think you have my Acked-by for this case already (from Aug 20).  And
> feel free to copy me on anything you like; my delete key works well :)

I didn't mean for this to sound like "I'll just delete any email you
send me"; I intended more like "feel free to copy me and if it's
something I'm interested or knowledgeable about, I'll try to help and
if not, it's easy for me to ignore it."

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-28 13:02                     ` Bjorn Helgaas
  0 siblings, 0 replies; 80+ messages in thread
From: Bjorn Helgaas @ 2013-08-28 13:02 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Thierry Reding, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On 08/27/2013 02:14 AM, Thierry Reding wrote:

>>> If Stephen's fine with it I suppose we could take pci-tegra.c
>>> driver changes through the Tegra tree. But I think it'd be good if
>>> we could still Cc you on patches so you're aware of what we're
>>> doing (that is the same for all drivers drivers/pci/host/*). And
>>> we're going to need your Acked-by on the patches as well.
>
> I think you have my Acked-by for this case already (from Aug 20).  And
> feel free to copy me on anything you like; my delete key works well :)

I didn't mean for this to sound like "I'll just delete any email you
send me"; I intended more like "feel free to copy me and if it's
something I'm interested or knowledgeable about, I'll try to help and
if not, it's easy for me to ignore it."

Bjorn

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-28 13:02                     ` Bjorn Helgaas
  (?)
@ 2013-08-28 13:27                         ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-28 13:27 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Warren, Julia Lawall,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

On Wed, Aug 28, 2013 at 07:02:16AM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:
> >> On 08/27/2013 02:14 AM, Thierry Reding wrote:
> 
> >>> If Stephen's fine with it I suppose we could take pci-tegra.c
> >>> driver changes through the Tegra tree. But I think it'd be good if
> >>> we could still Cc you on patches so you're aware of what we're
> >>> doing (that is the same for all drivers drivers/pci/host/*). And
> >>> we're going to need your Acked-by on the patches as well.
> >
> > I think you have my Acked-by for this case already (from Aug 20).  And
> > feel free to copy me on anything you like; my delete key works well :)
> 
> I didn't mean for this to sound like "I'll just delete any email you
> send me"; I intended more like "feel free to copy me and if it's
> something I'm interested or knowledgeable about, I'll try to help and
> if not, it's easy for me to ignore it."

That's exactly the way I understood it. =)

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-28 13:27                         ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-28 13:27 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Warren, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

On Wed, Aug 28, 2013 at 07:02:16AM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> >> On 08/27/2013 02:14 AM, Thierry Reding wrote:
> 
> >>> If Stephen's fine with it I suppose we could take pci-tegra.c
> >>> driver changes through the Tegra tree. But I think it'd be good if
> >>> we could still Cc you on patches so you're aware of what we're
> >>> doing (that is the same for all drivers drivers/pci/host/*). And
> >>> we're going to need your Acked-by on the patches as well.
> >
> > I think you have my Acked-by for this case already (from Aug 20).  And
> > feel free to copy me on anything you like; my delete key works well :)
> 
> I didn't mean for this to sound like "I'll just delete any email you
> send me"; I intended more like "feel free to copy me and if it's
> something I'm interested or knowledgeable about, I'll try to help and
> if not, it's easy for me to ignore it."

That's exactly the way I understood it. =)

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-28 13:27                         ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-28 13:27 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Warren, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

On Wed, Aug 28, 2013 at 07:02:16AM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> >> On 08/27/2013 02:14 AM, Thierry Reding wrote:
> 
> >>> If Stephen's fine with it I suppose we could take pci-tegra.c
> >>> driver changes through the Tegra tree. But I think it'd be good if
> >>> we could still Cc you on patches so you're aware of what we're
> >>> doing (that is the same for all drivers drivers/pci/host/*). And
> >>> we're going to need your Acked-by on the patches as well.
> >
> > I think you have my Acked-by for this case already (from Aug 20).  And
> > feel free to copy me on anything you like; my delete key works well :)
> 
> I didn't mean for this to sound like "I'll just delete any email you
> send me"; I intended more like "feel free to copy me and if it's
> something I'm interested or knowledgeable about, I'll try to help and
> if not, it's easy for me to ignore it."

That's exactly the way I understood it. =)

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-27 18:03                   ` Bjorn Helgaas
  (?)
@ 2013-08-28 13:31                       ` Thierry Reding
  -1 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-28 13:31 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Warren, Julia Lawall,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 3022 bytes --]

On Tue, Aug 27, 2013 at 12:03:01PM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> > On 08/27/2013 02:14 AM, Thierry Reding wrote:
> >> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> >>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> >>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >>>>> <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >>>>>
> >>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
> >>>>>> driver in the future? Do you want me to prepare a branch
> >>>>>> and pull from that or would you rather just take simple
> >>>>>> patches?
> >>>>>
> >>>>> I'm in the habit of applying patches from email, so that's
> >>>>> easy for me.  But a branch would be OK, too.
> >>>>
> >>>> Patches work for me too. Is this cleanup patch something that
> >>>> you'd be comfortable with applying after 3.12-rc1 or would you
> >>>> rather defer it to 3.13?
> >>>
> >>> I'm not really sure how we should manage drivers/pci/host/*.
> >>> Those files are mostly arch code, and I'm not sure it's useful
> >>> for me to be in the middle of managing them.
> >>>
> >>> I assume Stephen or somebody has a tree with the pci-tegra.c
> >>> stuff that's in -next right now; it seems like it'd be simplest
> >>> to just add this patch there and merge in during the v3.12 merge
> >>> window.
> >>
> >> If Stephen's fine with it I suppose we could take pci-tegra.c
> >> driver changes through the Tegra tree. But I think it'd be good if
> >> we could still Cc you on patches so you're aware of what we're
> >> doing (that is the same for all drivers drivers/pci/host/*). And
> >> we're going to need your Acked-by on the patches as well.
> 
> I think you have my Acked-by for this case already (from Aug 20).  And
> feel free to copy me on anything you like; my delete key works well :)
> 
> > I can push Tegra PCIe patches through the arm-soc tree before
> > 3.12-rc1, but after that point, I think it's best if they go through
> > the PCIe tree, unless there's some cross-subsystem dependency for a
> > specific patch, and with the new PCIe driver, that's less likely.
> 
> I'm OK with merging things through my tree.  It just seemed like there
> was a lot of recent Tegra activity that included a few Tegra PCI
> changes, and no benefit to trying to split the PCI stuff from the
> non-PCI stuff.  Hopefully it will calm down, because I don't have time
> to be in the middle of major Tegra stuff.

Yes, I think it will calm down. The difficulty this time around was that
there were various dependencies across multiple trees that needed to be
coordinated. As Stephen already mentioned, part of the reason to move
the driver out of arch/arm/mach-tegra was to make it stand on its own.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-28 13:31                       ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-28 13:31 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Warren, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2936 bytes --]

On Tue, Aug 27, 2013 at 12:03:01PM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > On 08/27/2013 02:14 AM, Thierry Reding wrote:
> >> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> >>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> >>> <thierry.reding@gmail.com> wrote:
> >>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >>>>> <thierry.reding@gmail.com> wrote:
> >>>>>
> >>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
> >>>>>> driver in the future? Do you want me to prepare a branch
> >>>>>> and pull from that or would you rather just take simple
> >>>>>> patches?
> >>>>>
> >>>>> I'm in the habit of applying patches from email, so that's
> >>>>> easy for me.  But a branch would be OK, too.
> >>>>
> >>>> Patches work for me too. Is this cleanup patch something that
> >>>> you'd be comfortable with applying after 3.12-rc1 or would you
> >>>> rather defer it to 3.13?
> >>>
> >>> I'm not really sure how we should manage drivers/pci/host/*.
> >>> Those files are mostly arch code, and I'm not sure it's useful
> >>> for me to be in the middle of managing them.
> >>>
> >>> I assume Stephen or somebody has a tree with the pci-tegra.c
> >>> stuff that's in -next right now; it seems like it'd be simplest
> >>> to just add this patch there and merge in during the v3.12 merge
> >>> window.
> >>
> >> If Stephen's fine with it I suppose we could take pci-tegra.c
> >> driver changes through the Tegra tree. But I think it'd be good if
> >> we could still Cc you on patches so you're aware of what we're
> >> doing (that is the same for all drivers drivers/pci/host/*). And
> >> we're going to need your Acked-by on the patches as well.
> 
> I think you have my Acked-by for this case already (from Aug 20).  And
> feel free to copy me on anything you like; my delete key works well :)
> 
> > I can push Tegra PCIe patches through the arm-soc tree before
> > 3.12-rc1, but after that point, I think it's best if they go through
> > the PCIe tree, unless there's some cross-subsystem dependency for a
> > specific patch, and with the new PCIe driver, that's less likely.
> 
> I'm OK with merging things through my tree.  It just seemed like there
> was a lot of recent Tegra activity that included a few Tegra PCI
> changes, and no benefit to trying to split the PCI stuff from the
> non-PCI stuff.  Hopefully it will calm down, because I don't have time
> to be in the middle of major Tegra stuff.

Yes, I think it will calm down. The difficulty this time around was that
there were various dependencies across multiple trees that needed to be
coordinated. As Stephen already mentioned, part of the reason to move
the driver out of arch/arm/mach-tegra was to make it stand on its own.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-28 13:31                       ` Thierry Reding
  0 siblings, 0 replies; 80+ messages in thread
From: Thierry Reding @ 2013-08-28 13:31 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Warren, Julia Lawall, kernel-janitors, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2936 bytes --]

On Tue, Aug 27, 2013 at 12:03:01PM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > On 08/27/2013 02:14 AM, Thierry Reding wrote:
> >> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> >>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> >>> <thierry.reding@gmail.com> wrote:
> >>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >>>>> <thierry.reding@gmail.com> wrote:
> >>>>>
> >>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
> >>>>>> driver in the future? Do you want me to prepare a branch
> >>>>>> and pull from that or would you rather just take simple
> >>>>>> patches?
> >>>>>
> >>>>> I'm in the habit of applying patches from email, so that's
> >>>>> easy for me.  But a branch would be OK, too.
> >>>>
> >>>> Patches work for me too. Is this cleanup patch something that
> >>>> you'd be comfortable with applying after 3.12-rc1 or would you
> >>>> rather defer it to 3.13?
> >>>
> >>> I'm not really sure how we should manage drivers/pci/host/*.
> >>> Those files are mostly arch code, and I'm not sure it's useful
> >>> for me to be in the middle of managing them.
> >>>
> >>> I assume Stephen or somebody has a tree with the pci-tegra.c
> >>> stuff that's in -next right now; it seems like it'd be simplest
> >>> to just add this patch there and merge in during the v3.12 merge
> >>> window.
> >>
> >> If Stephen's fine with it I suppose we could take pci-tegra.c
> >> driver changes through the Tegra tree. But I think it'd be good if
> >> we could still Cc you on patches so you're aware of what we're
> >> doing (that is the same for all drivers drivers/pci/host/*). And
> >> we're going to need your Acked-by on the patches as well.
> 
> I think you have my Acked-by for this case already (from Aug 20).  And
> feel free to copy me on anything you like; my delete key works well :)
> 
> > I can push Tegra PCIe patches through the arm-soc tree before
> > 3.12-rc1, but after that point, I think it's best if they go through
> > the PCIe tree, unless there's some cross-subsystem dependency for a
> > specific patch, and with the new PCIe driver, that's less likely.
> 
> I'm OK with merging things through my tree.  It just seemed like there
> was a lot of recent Tegra activity that included a few Tegra PCI
> changes, and no benefit to trying to split the PCI stuff from the
> non-PCI stuff.  Hopefully it will calm down, because I don't have time
> to be in the middle of major Tegra stuff.

Yes, I think it will calm down. The difficulty this time around was that
there were various dependencies across multiple trees that needed to be
coordinated. As Stephen already mentioned, part of the reason to move
the driver out of arch/arm/mach-tegra was to make it stand on its own.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20   ` Julia Lawall
@ 2013-08-30  9:42     ` Tomi Valkeinen
  -1 siblings, 0 replies; 80+ messages in thread
From: Tomi Valkeinen @ 2013-08-30  9:42 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jean-Christophe Plagniol-Villard, kernel-janitors, linux-fbdev,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

On 19/08/13 14:20, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The initialization of drvdata->regs_phys was manually moved lower, to take
> advantage of the NULL test on res performed by devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/video/xilinxfb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
> index 6629b29..84c664e 100644
> --- a/drivers/video/xilinxfb.c
> +++ b/drivers/video/xilinxfb.c
> @@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
>  		struct resource *res;
>  
>  		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		drvdata->regs_phys = res->start;
> -		drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
> -		if (!drvdata->regs) {
> -			rc = -EADDRNOTAVAIL;
> +		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(drvdata->regs)) {
> +			rc = PTR_ERR(drvdata->regs);
>  			goto err_region;
>  		}
> +		drvdata->regs_phys = res->start;
>  	}
>  
>  	/* Allocate the framebuffer memory */

Thanks, queued for 3.12.

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-30  9:42     ` Tomi Valkeinen
  0 siblings, 0 replies; 80+ messages in thread
From: Tomi Valkeinen @ 2013-08-30  9:42 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jean-Christophe Plagniol-Villard, kernel-janitors, linux-fbdev,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

On 19/08/13 14:20, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The initialization of drvdata->regs_phys was manually moved lower, to take
> advantage of the NULL test on res performed by devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/video/xilinxfb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
> index 6629b29..84c664e 100644
> --- a/drivers/video/xilinxfb.c
> +++ b/drivers/video/xilinxfb.c
> @@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
>  		struct resource *res;
>  
>  		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		drvdata->regs_phys = res->start;
> -		drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
> -		if (!drvdata->regs) {
> -			rc = -EADDRNOTAVAIL;
> +		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(drvdata->regs)) {
> +			rc = PTR_ERR(drvdata->regs);
>  			goto err_region;
>  		}
> +		drvdata->regs_phys = res->start;
>  	}
>  
>  	/* Allocate the framebuffer memory */

Thanks, queued for 3.12.

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 4/7] dma: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20   ` Julia Lawall
@ 2013-09-02 12:19     ` Vinod Koul
  -1 siblings, 0 replies; 80+ messages in thread
From: Vinod Koul @ 2013-09-02 12:07 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Dan Williams, linux-kernel

On Mon, Aug 19, 2013 at 01:20:38PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
Applied, thanks

~Vinod


^ permalink raw reply	[flat|nested] 80+ messages in thread

* Re: [PATCH 4/7] dma: replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-09-02 12:19     ` Vinod Koul
  0 siblings, 0 replies; 80+ messages in thread
From: Vinod Koul @ 2013-09-02 12:19 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Dan Williams, linux-kernel

On Mon, Aug 19, 2013 at 01:20:38PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
Applied, thanks

~Vinod


^ permalink raw reply	[flat|nested] 80+ messages in thread

end of thread, other threads:[~2013-09-02 12:53 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19 11:20 [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource Julia Lawall
2013-08-19 11:20 ` Julia Lawall
2013-08-19 11:20 ` Julia Lawall
2013-08-19 11:20 ` [PATCH 1/7] PCI: tegra: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-08-19 12:02   ` Thierry Reding
2013-08-19 12:02     ` Thierry Reding
2013-08-19 12:07     ` Julia Lawall
2013-08-19 12:07       ` Julia Lawall
2013-08-19 12:07       ` Julia Lawall
2013-08-19 12:12       ` Thierry Reding
2013-08-19 12:12         ` Thierry Reding
2013-08-19 12:15         ` Julia Lawall
2013-08-19 12:15           ` Julia Lawall
2013-08-19 12:15           ` Julia Lawall
2013-08-19 19:33           ` Thierry Reding
2013-08-19 19:33             ` Thierry Reding
2013-08-19 19:33             ` Thierry Reding
2013-08-19 20:56             ` Stephen Warren
2013-08-19 20:56               ` Stephen Warren
2013-08-19 20:56               ` Stephen Warren
2013-08-20  9:13             ` Julia Lawall
2013-08-20  9:13               ` Julia Lawall
2013-08-20  9:13               ` Julia Lawall
2013-08-20 16:26               ` Bjorn Helgaas
2013-08-20 16:26                 ` Bjorn Helgaas
2013-08-20 16:26                 ` Bjorn Helgaas
2013-08-20 18:53                 ` Stephen Warren
2013-08-20 18:53                   ` Stephen Warren
     [not found]                   ` <5213BB2C.60908-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-20 19:31                     ` Thierry Reding
2013-08-20 19:31                       ` Thierry Reding
2013-08-20 19:31                       ` Thierry Reding
2013-08-19 20:04     ` Bjorn Helgaas
2013-08-19 20:04       ` Bjorn Helgaas
2013-08-19 20:12       ` Thierry Reding
2013-08-19 20:12         ` Thierry Reding
2013-08-19 20:49         ` Bjorn Helgaas
2013-08-19 20:49           ` Bjorn Helgaas
2013-08-19 20:49           ` Bjorn Helgaas
2013-08-27  8:14           ` Thierry Reding
2013-08-27  8:14             ` Thierry Reding
2013-08-27 16:11             ` Stephen Warren
2013-08-27 16:11               ` Stephen Warren
2013-08-27 16:11               ` Stephen Warren
     [not found]               ` <521CCF9B.9000004-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-27 18:03                 ` Bjorn Helgaas
2013-08-27 18:03                   ` Bjorn Helgaas
2013-08-27 18:03                   ` Bjorn Helgaas
2013-08-28 13:02                   ` Bjorn Helgaas
2013-08-28 13:02                     ` Bjorn Helgaas
     [not found]                     ` <CAErSpo5LOig3KPGfyWJ1BWA61Ox3cyrguSo_XdVqw6SqxttXeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-28 13:27                       ` Thierry Reding
2013-08-28 13:27                         ` Thierry Reding
2013-08-28 13:27                         ` Thierry Reding
     [not found]                   ` <CAErSpo461H=3qD5Xb7rKkMcQ1_ipyAQ5Tv2VhZD4j578A+Bd9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-28 13:31                     ` Thierry Reding
2013-08-28 13:31                       ` Thierry Reding
2013-08-28 13:31                       ` Thierry Reding
2013-08-19 11:20 ` [PATCH 2/7] serial: st-asc: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-08-19 11:20 ` [PATCH 3/7] iommu/arm: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-08-20 11:35   ` Will Deacon
2013-08-20 11:35     ` Will Deacon
2013-08-20 11:35     ` Will Deacon
2013-08-20 11:49     ` Julia Lawall
2013-08-20 11:49       ` Julia Lawall
2013-08-20 11:49       ` Julia Lawall
2013-08-19 11:20 ` [PATCH 4/7] dma: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-09-02 12:07   ` Vinod Koul
2013-09-02 12:19     ` Vinod Koul
2013-08-19 11:20 ` [PATCH 5/7] bcm63xx_enet: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-08-21  6:22   ` David Miller
2013-08-21  6:22     ` David Miller
2013-08-19 11:20 ` [PATCH 6/7] video: xilinxfb: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall
2013-08-30  9:42   ` Tomi Valkeinen
2013-08-30  9:42     ` Tomi Valkeinen
2013-08-19 11:20 ` [PATCH 7/7] mmc: mvsdio: " Julia Lawall
2013-08-19 11:20   ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.