2013-06-10 11:49:51

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 00/15] Convert to use devm_ioremap_resource

These are the remaining instances of devm_request_and_ioremap. Convert
them to use devm_ioremap_resource as introduced by commit
75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()).
Patches 1 to 13 remove occurrences of devm_request_and_ioremap.
Patch 14 modifies one comment that speaks about devm_request_and_ioremap.
Patch 15 removes the definition of devm_request_and_ioremap which
should only be applied if all other pathces are merged.

Tushar Behera (15):
sparc,leon: Convert to use devm_ioremap_resource
sudmac: Convert to use devm_ioremap_resource
mmc: mvsdio: Convert to use devm_ioremap_resource
gpio_msm: Convert to use devm_ioremap_resource
gpio-sta2x11: Convert to use devm_ioremap_resource
net: bcm63xx_enet: Convert to use devm_ioremap_resource
net: fec: Convert to use devm_ioremap_resource
net: emaclite: Convert to use devm_ioremap_resource
net: can: Convert to use devm_ioremap_resource
Staging: netlogic: Convert to use devm_ioremap_resource
regulator: ti-abb: Convert to use devm_ioremap_resource
ASoC: spear: Convert to use devm_ioremap_resource
pci: mvebu: Convert to use devm_ioremap_resource
usb: phy: rcar-usb: Fix comment w.r.t. devm_ioremap_resource
lib: devres: Remove deprecated devm_request_and_ioremap

Documentation/driver-model/devres.txt | 1 -
arch/sparc/kernel/leon_pci_grpci1.c | 6 +++---
drivers/dma/sh/sudmac.c | 6 +++---
drivers/gpio/gpio-msm-v1.c | 12 +++++------
drivers/gpio/gpio-sta2x11.c | 4 +++-
drivers/mmc/host/mvsdio.c | 6 +++---
drivers/net/can/c_can/c_can_platform.c | 4 ++--
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 12 +++++------
drivers/net/ethernet/freescale/fec_main.c | 12 +++++------
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++++--
drivers/pci/host/pci-mvebu.c | 5 +++--
drivers/regulator/ti-abb-regulator.c | 12 +++++------
drivers/staging/netlogic/xlr_net.c | 8 +++----
drivers/usb/phy/phy-rcar-usb.c | 2 +-
include/linux/device.h | 2 --
lib/devres.c | 28 -------------------------
sound/soc/spear/spdif_out.c | 20 +++++-------------
17 files changed, 55 insertions(+), 91 deletions(-)

CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Bjorn Helgaas <[email protected]>
CC: Chris Ball <[email protected]>
CC: Dan Williams <[email protected]>
CC: "David S. Miller" <[email protected]>
CC: Felipe Balbi <[email protected]>
CC: Grant Likely <[email protected]>
CC: Greg Kroah-Hartman <[email protected]>
CC: Liam Girdwood <[email protected]>
CC: Linus Walleij <[email protected]>
CC: Marc Kleine-Budde <[email protected]>
CC: Mark Brown <[email protected]>
CC: Michal Simek <[email protected]>
CC: Rob Landley <[email protected]>
CC: Vinod Koul <[email protected]>
CC: Wolfgang Grandegger <[email protected]>
--
1.7.9.5


2013-06-10 11:50:02

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 01/15] sparc,leon: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: "David S. Miller" <[email protected]>
---
* Not compile tested.
arch/sparc/kernel/leon_pci_grpci1.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
index 7739a54..23497f4 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -536,10 +536,10 @@ static int grpci1_of_probe(struct platform_device *ofdev)

/* find device register base address */
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
- regs = devm_request_and_ioremap(&ofdev->dev, res);
- if (!regs) {
+ regs = devm_ioremap_resource(&ofdev->dev, res);
+ if (IS_ERR(regs)) {
dev_err(&ofdev->dev, "io-regs mapping failed\n");
- return -EADDRNOTAVAIL;
+ return PTR_ERR(regs);
}

/*
--
1.7.9.5

2013-06-10 11:50:08

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 04/15] gpio_msm: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Linus Walleij <[email protected]>
CC: Grant Likely <[email protected]>
---
drivers/gpio/gpio-msm-v1.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
index c798585a..c0ead43 100644
--- a/drivers/gpio/gpio-msm-v1.c
+++ b/drivers/gpio/gpio-msm-v1.c
@@ -652,14 +652,14 @@ static int __devinit gpio_msm_v1_probe(struct platform_device *pdev)
return irq2;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base1 = devm_request_and_ioremap(&pdev->dev, res);
- if (!base1)
- return -EADDRNOTAVAIL;
+ base1 = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(base1))
+ return PTR_ERR(base1);

res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- base2 = devm_request_and_ioremap(&pdev->dev, res);
- if (!base2)
- return -EADDRNOTAVAIL;
+ base2 = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(base2))
+ return PTR_ERR(base2);

for (i = FIRST_GPIO_IRQ; i < FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) {
if (i - FIRST_GPIO_IRQ >=
--
1.7.9.5

2013-06-10 11:50:22

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 07/15] net: fec: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: "David S. Miller" <[email protected]>
---
drivers/net/ethernet/freescale/fec_main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c42c42a..b0d36b7 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1876,17 +1876,17 @@ fec_probe(struct platform_device *pdev)
(pdev->id_entry->driver_data & FEC_QUIRK_HAS_GBIT))
fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;

- fep->hwp = devm_request_and_ioremap(&pdev->dev, r);
+ fep->hwp = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(fep->hwp)) {
+ ret = PTR_ERR(fep->hwp);
+ goto failed_ioremap;
+ }
+
fep->pdev = pdev;
fep->dev_id = dev_id++;

fep->bufdesc_ex = 0;

- if (!fep->hwp) {
- ret = -ENOMEM;
- goto failed_ioremap;
- }
-
platform_set_drvdata(pdev, ndev);

ret = of_get_phy_mode(pdev->dev.of_node);
--
1.7.9.5

2013-06-10 11:50:32

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: [email protected]
CC: Marc Kleine-Budde <[email protected]>
CC: Wolfgang Grandegger <[email protected]>
---
drivers/net/can/c_can/c_can_platform.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 6b6130b..b918c73 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -201,8 +201,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
priv->instance = pdev->id;

res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- priv->raminit_ctrlreg = devm_request_and_ioremap(&pdev->dev, res);
- if (!priv->raminit_ctrlreg || priv->instance < 0)
+ priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
dev_info(&pdev->dev, "control memory is not used for raminit\n");
else
priv->raminit = c_can_hw_raminit;
--
1.7.9.5

2013-06-10 11:50:41

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: Mark Brown <[email protected]>
CC: Liam Girdwood <[email protected]>
---
drivers/regulator/ti-abb-regulator.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
index 870d209..f494a11 100644
--- a/drivers/regulator/ti-abb-regulator.c
+++ b/drivers/regulator/ti-abb-regulator.c
@@ -722,10 +722,10 @@ static int ti_abb_probe(struct platform_device *pdev)
ret = -ENODEV;
goto err;
}
- abb->base = devm_request_and_ioremap(dev, res);
- if (!abb->base) {
+ abb->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(abb->base)) {
dev_err(dev, "Unable to map '%s'\n", pname);
- ret = -ENOMEM;
+ ret = PTR_ERR(abb->base);
goto err;
}

@@ -776,10 +776,10 @@ static int ti_abb_probe(struct platform_device *pdev)
ret = -ENODEV;
goto skip_opt;
}
- abb->ldo_base = devm_request_and_ioremap(dev, res);
- if (!abb->ldo_base) {
+ abb->ldo_base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(abb->ldo_base)) {
dev_err(dev, "Unable to map '%s'\n", pname);
- ret = -ENOMEM;
+ ret = PTR_ERR(abb->ldo_base);
goto err;
}

--
1.7.9.5

2013-06-10 11:50:57

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 15/15] lib: devres: Remove deprecated devm_request_and_ioremap

Now that all the users of devm_request_and_ioremap have been converted
to use devm_ioremap_resource, remove the definition.

Also remove the entries from Documentation.

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Rob Landley <[email protected]>
CC: Greg Kroah-Hartman <[email protected]>
---
Documentation/driver-model/devres.txt | 1 -
include/linux/device.h | 2 --
lib/devres.c | 28 ----------------------------
3 files changed, 31 deletions(-)

diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index b467145..c085bbb 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -267,7 +267,6 @@ IOMAP
devm_ioremap_nocache()
devm_iounmap()
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
- devm_request_and_ioremap() : obsoleted by devm_ioremap_resource()
pcim_iomap()
pcim_iounmap()
pcim_iomap_table() : array of mapped addresses indexed by BAR
diff --git a/include/linux/device.h b/include/linux/device.h
index eeb3331..ba99ee2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -580,8 +580,6 @@ extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
extern void devm_kfree(struct device *dev, void *p);

void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
-void __iomem *devm_request_and_ioremap(struct device *dev,
- struct resource *res);

/* allows to add/remove a custom action to devres stack */
int devm_add_action(struct device *dev, void (*action)(void *), void *data);
diff --git a/lib/devres.c b/lib/devres.c
index 8235331..3ddb56d 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -140,34 +140,6 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
}
EXPORT_SYMBOL(devm_ioremap_resource);

-/**
- * devm_request_and_ioremap() - Check, request region, and ioremap resource
- * @dev: Generic device to handle the resource for
- * @res: resource to be handled
- *
- * Takes all necessary steps to ioremap a mem resource. Uses managed device, so
- * everything is undone on driver detach. Checks arguments, so you can feed
- * it the result from e.g. platform_get_resource() directly. Returns the
- * remapped pointer or NULL on error. Usage example:
- *
- * res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- * base = devm_request_and_ioremap(&pdev->dev, res);
- * if (!base)
- * return -EADDRNOTAVAIL;
- */
-void __iomem *devm_request_and_ioremap(struct device *device,
- struct resource *res)
-{
- void __iomem *dest_ptr;
-
- dest_ptr = devm_ioremap_resource(device, res);
- if (IS_ERR(dest_ptr))
- return NULL;
-
- return dest_ptr;
-}
-EXPORT_SYMBOL(devm_request_and_ioremap);
-
#ifdef CONFIG_HAS_IOPORT
/*
* Generic iomap devres
--
1.7.9.5

2013-06-10 11:50:48

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 12/15] ASoC: spear: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Liam Girdwood <[email protected]>
CC: Mark Brown <[email protected]>
---
sound/soc/spear/spdif_out.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index 4bde512..896ee7f 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -282,27 +282,17 @@ static int spdif_out_probe(struct platform_device *pdev)
struct resource *res;
int ret;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
-
- if (!devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name)) {
- dev_warn(&pdev->dev, "Failed to get memory resourse\n");
- return -ENOENT;
- }
-
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
if (!host) {
dev_warn(&pdev->dev, "kzalloc fail\n");
return -ENOMEM;
}

- host->io_base = devm_request_and_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!host->io_base) {
- dev_warn(&pdev->dev, "ioremap failed\n");
- return -ENOMEM;
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ host->io_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(host->io_base)) {
+ dev_warn(&pdev->dev, "devm_ioremap_resource failed\n");
+ return PTR_ERR(host->io_base);
}

host->clk = devm_clk_get(&pdev->dev, NULL);
--
1.7.9.5

2013-06-10 11:50:53

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 14/15] usb: phy: rcar-usb: Fix comment w.r.t. devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Felipe Balbi <[email protected]>
---
drivers/usb/phy/phy-rcar-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-rcar-usb.c b/drivers/usb/phy/phy-rcar-usb.c
index a35681b..23c3dd3 100644
--- a/drivers/usb/phy/phy-rcar-usb.c
+++ b/drivers/usb/phy/phy-rcar-usb.c
@@ -161,7 +161,7 @@ static int rcar_usb_phy_probe(struct platform_device *pdev)
* CAUTION
*
* Because this phy address is also mapped under OHCI/EHCI address area,
- * this driver can't use devm_request_and_ioremap(dev, res) here
+ * this driver can't use devm_ioremap_resource(dev, res) here
*/
reg0 = devm_ioremap_nocache(dev, res0->start, resource_size(res0));
reg1 = devm_ioremap_nocache(dev, res1->start, resource_size(res1));
--
1.7.9.5

2013-06-10 11:51:37

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 13/15] pci: mvebu: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Bjorn Helgaas <[email protected]>
---
drivers/pci/host/pci-mvebu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 13a633b..e714876 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -752,7 +752,7 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
if (ret)
return NULL;

- return devm_request_and_ioremap(&pdev->dev, &regs);
+ return devm_ioremap_resource(&pdev->dev, &regs);
}

static int __init mvebu_pcie_probe(struct platform_device *pdev)
@@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
continue;

port->base = mvebu_pcie_map_registers(pdev, child, port);
- if (!port->base) {
+ if (IS_ERR(port->base)) {
dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
port->port, port->lane);
+ port->base = NULL;
continue;
}

--
1.7.9.5

2013-06-10 11:50:38

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 10/15] Staging: netlogic: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Greg Kroah-Hartman <[email protected]>
---
drivers/staging/netlogic/xlr_net.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index dd98cb1..c30fa54 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -1020,12 +1020,12 @@ static int xlr_net_probe(struct platform_device *pdev)
goto err_gmac;
}

- ndev->base_addr = (unsigned long) devm_request_and_ioremap
+ ndev->base_addr = (unsigned long) devm_ioremap_resource
(&pdev->dev, res);
- if (!ndev->base_addr) {
+ if (IS_ERR_VALUE(ndev->base_addr)) {
dev_err(&pdev->dev,
- "devm_request_and_ioremap failed\n");
- return -EBUSY;
+ "devm_ioremap_resource failed\n");
+ return ndev->base_addr;
}

res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
--
1.7.9.5

2013-06-10 11:52:31

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 08/15] net: emaclite: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: "David S. Miller" <[email protected]>
CC: Michal Simek <[email protected]>
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 1cd131b..fd4dbda 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1159,9 +1159,11 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
ndev->irq = res->start;

res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
- lp->base_addr = devm_request_and_ioremap(&ofdev->dev, res);
- if (!lp->base_addr)
+ lp->base_addr = devm_ioremap_resource(&ofdev->dev, res);
+ if (IS_ERR(lp->base_addr)) {
+ rc = PTR_ERR(lp->base_addr);
goto error;
+ }

ndev->mem_start = res->start;
ndev->mem_end = res->end;
--
1.7.9.5

2013-06-10 11:50:16

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 05/15] gpio-sta2x11: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Grant Likely <[email protected]>
CC: Linus Walleij <[email protected]>
---
drivers/gpio/gpio-sta2x11.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
index 5585425..c977c14 100644
--- a/drivers/gpio/gpio-sta2x11.c
+++ b/drivers/gpio/gpio-sta2x11.c
@@ -372,7 +372,9 @@ static int gsta_probe(struct platform_device *dev)

chip = devm_kzalloc(&dev->dev, sizeof(*chip), GFP_KERNEL);
chip->dev = &dev->dev;
- chip->reg_base = devm_request_and_ioremap(&dev->dev, res);
+ chip->reg_base = devm_ioremap_resource(&dev->dev, res);
+ if (IS_ERR(chip->reg_base))
+ return PTR_ERR(chip->reg_base);

for (i = 0; i < GSTA_NR_BLOCKS; i++) {
chip->regs[i] = chip->reg_base + i * 4096;
--
1.7.9.5

2013-06-10 11:53:19

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 06/15] net: bcm63xx_enet: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: "David S. Miller" <[email protected]>
---
* Not compile tested.

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

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index e46466c..d690308 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1641,9 +1641,9 @@ 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;
+ priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
+ if (IS_ERR(priv->base)) {
+ ret = PTR_ERR(priv->base);
goto out;
}

@@ -1871,9 +1871,9 @@ static int bcm_enet_shared_probe(struct platform_device *pdev)
if (!res)
return -ENODEV;

- bcm_enet_shared_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!bcm_enet_shared_base)
- return -ENOMEM;
+ bcm_enet_shared_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(bcm_enet_shared_base))
+ return PTR_ERR(bcp_enet_shared_base);

return 0;
}
--
1.7.9.5

2013-06-10 11:49:59

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 02/15] sudmac: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: Vinod Koul <[email protected]>
CC: Dan Williams <[email protected]>
---
drivers/dma/sh/sudmac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index e7c94bb..0a81e30 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -360,9 +360,9 @@ 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;
+ 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);

--
1.7.9.5

2013-06-10 11:53:59

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 03/15] mmc: mvsdio: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Chris Ball <[email protected]>
---
drivers/mmc/host/mvsdio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index d08fe6a..656f1f5 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -758,9 +758,9 @@ 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;
+ host->base = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(host->base)) {
+ ret = PTR_ERR(host->base);
goto out;
}

--
1.7.9.5

2013-06-10 12:01:51

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On 10 June 2013 17:05, Tushar Behera <[email protected]> wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: Mark Brown <[email protected]>
> CC: Liam Girdwood <[email protected]>
> ---
> drivers/regulator/ti-abb-regulator.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
> index 870d209..f494a11 100644
> --- a/drivers/regulator/ti-abb-regulator.c
> +++ b/drivers/regulator/ti-abb-regulator.c
> @@ -722,10 +722,10 @@ static int ti_abb_probe(struct platform_device *pdev)
> ret = -ENODEV;
> goto err;
> }
> - abb->base = devm_request_and_ioremap(dev, res);
> - if (!abb->base) {
> + abb->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(abb->base)) {
> dev_err(dev, "Unable to map '%s'\n", pname);

You may remove the above error message as devm_ioremap_resource prints
its own error messages.

> - ret = -ENOMEM;
> + ret = PTR_ERR(abb->base);
> goto err;
> }
>
> @@ -776,10 +776,10 @@ static int ti_abb_probe(struct platform_device *pdev)
> ret = -ENODEV;
> goto skip_opt;
> }
> - abb->ldo_base = devm_request_and_ioremap(dev, res);
> - if (!abb->ldo_base) {
> + abb->ldo_base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(abb->ldo_base)) {
> dev_err(dev, "Unable to map '%s'\n", pname);

ditto

> - ret = -ENOMEM;
> + ret = PTR_ERR(abb->ldo_base);
> goto err;
> }
>
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
With warm regards,
Sachin

2013-06-10 12:03:24

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 01/15] sparc,leon: Convert to use devm_ioremap_resource

On 10 June 2013 17:04, Tushar Behera <[email protected]> wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: "David S. Miller" <[email protected]>
> ---
> * Not compile tested.
> arch/sparc/kernel/leon_pci_grpci1.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
> index 7739a54..23497f4 100644
> --- a/arch/sparc/kernel/leon_pci_grpci1.c
> +++ b/arch/sparc/kernel/leon_pci_grpci1.c
> @@ -536,10 +536,10 @@ static int grpci1_of_probe(struct platform_device *ofdev)
>
> /* find device register base address */
> res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> - regs = devm_request_and_ioremap(&ofdev->dev, res);
> - if (!regs) {
> + regs = devm_ioremap_resource(&ofdev->dev, res);
> + if (IS_ERR(regs)) {
> dev_err(&ofdev->dev, "io-regs mapping failed\n");

You may remove the above error message as devm_ioremap_resource prints
its own error messages.

> - return -EADDRNOTAVAIL;
> + return PTR_ERR(regs);
> }
>
> /*
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
With warm regards,
Sachin

2013-06-10 12:06:52

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 12/15] ASoC: spear: Convert to use devm_ioremap_resource

On 10 June 2013 17:05, Tushar Behera <[email protected]> wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().

This patch does a little more than just conversion. May that change
could be mentioned here.

>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Liam Girdwood <[email protected]>
> CC: Mark Brown <[email protected]>
> ---
> sound/soc/spear/spdif_out.c | 20 +++++---------------
> 1 file changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
> index 4bde512..896ee7f 100644
> --- a/sound/soc/spear/spdif_out.c
> +++ b/sound/soc/spear/spdif_out.c
> @@ -282,27 +282,17 @@ static int spdif_out_probe(struct platform_device *pdev)
> struct resource *res;
> int ret;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res)
> - return -EINVAL;
> -
> - if (!devm_request_mem_region(&pdev->dev, res->start,
> - resource_size(res), pdev->name)) {
> - dev_warn(&pdev->dev, "Failed to get memory resourse\n");
> - return -ENOENT;
> - }
> -
> host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> if (!host) {
> dev_warn(&pdev->dev, "kzalloc fail\n");
> return -ENOMEM;
> }
>
> - host->io_base = devm_request_and_ioremap(&pdev->dev, res->start,
> - resource_size(res));
> - if (!host->io_base) {
> - dev_warn(&pdev->dev, "ioremap failed\n");
> - return -ENOMEM;
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + host->io_base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(host->io_base)) {
> + dev_warn(&pdev->dev, "devm_ioremap_resource failed\n");

This print is not needed as devm_ioremap_resource prints its own messages.


> + return PTR_ERR(host->io_base);
> }
>
> host->clk = devm_clk_get(&pdev->dev, NULL);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
With warm regards,
Sachin

2013-06-10 12:17:31

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 14/15] usb: phy: rcar-usb: Fix comment w.r.t. devm_ioremap_resource

Hello.

On 10-06-2013 15:35, Tushar Behera wrote:

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().

> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Felipe Balbi <[email protected]>
> ---
> drivers/usb/phy/phy-rcar-usb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/drivers/usb/phy/phy-rcar-usb.c b/drivers/usb/phy/phy-rcar-usb.c
> index a35681b..23c3dd3 100644
> --- a/drivers/usb/phy/phy-rcar-usb.c
> +++ b/drivers/usb/phy/phy-rcar-usb.c
> @@ -161,7 +161,7 @@ static int rcar_usb_phy_probe(struct platform_device *pdev)
> * CAUTION
> *
> * Because this phy address is also mapped under OHCI/EHCI address area,
> - * this driver can't use devm_request_and_ioremap(dev, res) here
> + * this driver can't use devm_ioremap_resource(dev, res) here
> */
> reg0 = devm_ioremap_nocache(dev, res0->start, resource_size(res0));
> reg1 = devm_ioremap_nocache(dev, res1->start, resource_size(res1));

I'm completely removing this comment in my series pushed thru
renesas.git, so I advise this patch to be ignored not to create conflict
in the future.

WBR, Sergei

2013-06-10 13:09:42

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

On 06/10/2013 01:35 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().

Acked-by: Marc Kleine-Budde <[email protected]>

Are the patches going over the individual subsystem maintainers?

Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |


Attachments:
signature.asc (263.00 B)
OpenPGP digital signature

2013-06-10 14:29:31

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 13/15] pci: mvebu: Convert to use devm_ioremap_resource

On 10 June 2013 17:05, Tushar Behera <[email protected]> wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Bjorn Helgaas <[email protected]>
> ---
> drivers/pci/host/pci-mvebu.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> index 13a633b..e714876 100644
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -752,7 +752,7 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
> if (ret)
> return NULL;
>
> - return devm_request_and_ioremap(&pdev->dev, &regs);
> + return devm_ioremap_resource(&pdev->dev, &regs);
> }
>
> static int __init mvebu_pcie_probe(struct platform_device *pdev)
> @@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
> continue;
>
> port->base = mvebu_pcie_map_registers(pdev, child, port);
> - if (!port->base) {
> + if (IS_ERR(port->base)) {
> dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
> port->port, port->lane);

This error message is redundant.

> + port->base = NULL;
Probably this is also not needed.

> continue;
> }
>
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
With warm regards,
Sachin

2013-06-11 03:07:33

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 01/15] sparc,leon: Convert to use devm_ioremap_resource

On 06/10/2013 05:33 PM, Sachin Kamat wrote:
> On 10 June 2013 17:04, Tushar Behera <[email protected]> wrote:
>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> introduced devm_ioremap_resource() and deprecated the use of
>> devm_request_and_ioremap().
>>
>> Signed-off-by: Tushar Behera <[email protected]>
>> CC: [email protected]
>> CC: "David S. Miller" <[email protected]>
>> ---
>> * Not compile tested.
>> arch/sparc/kernel/leon_pci_grpci1.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
>> index 7739a54..23497f4 100644
>> --- a/arch/sparc/kernel/leon_pci_grpci1.c
>> +++ b/arch/sparc/kernel/leon_pci_grpci1.c
>> @@ -536,10 +536,10 @@ static int grpci1_of_probe(struct platform_device *ofdev)
>>
>> /* find device register base address */
>> res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
>> - regs = devm_request_and_ioremap(&ofdev->dev, res);
>> - if (!regs) {
>> + regs = devm_ioremap_resource(&ofdev->dev, res);
>> + if (IS_ERR(regs)) {
>> dev_err(&ofdev->dev, "io-regs mapping failed\n");
>
> You may remove the above error message as devm_ioremap_resource prints
> its own error messages.
>

Ok. I will remove the error message. I will do the same for other
instances too.

Thanks.

--
Tushar Behera

2013-06-11 03:15:55

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

+CC: 'Greg Kroah-Hartman' <[email protected]>

On 06/10/2013 06:39 PM, Marc Kleine-Budde wrote:
> On 06/10/2013 01:35 PM, Tushar Behera wrote:
>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> introduced devm_ioremap_resource() and deprecated the use of
>> devm_request_and_ioremap().
>
> Acked-by: Marc Kleine-Budde <[email protected]>
>
> Are the patches going over the individual subsystem maintainers?
>
> Marc
>

I am not sure. Looping in Greg for clarity.

--
Tushar Behera

2013-06-11 03:21:47

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 14/15] usb: phy: rcar-usb: Fix comment w.r.t. devm_ioremap_resource

On 06/10/2013 05:47 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 10-06-2013 15:35, Tushar Behera wrote:
>

[ ... ]

>> * CAUTION
>> *
>> * Because this phy address is also mapped under OHCI/EHCI
>> address area,
>> - * this driver can't use devm_request_and_ioremap(dev, res) here
>> + * this driver can't use devm_ioremap_resource(dev, res) here
>> */
>> reg0 = devm_ioremap_nocache(dev, res0->start, resource_size(res0));
>> reg1 = devm_ioremap_nocache(dev, res1->start, resource_size(res1));
>
> I'm completely removing this comment in my series pushed thru
> renesas.git, so I advise this patch to be ignored not to create conflict
> in the future.
>

Ok. I will drop this from the patchset.

> WBR, Sergei
>

Thanks.

--
Tushar Behera

2013-06-11 03:51:35

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 12/15] ASoC: spear: Convert to use devm_ioremap_resource

On 06/10/2013 05:36 PM, Sachin Kamat wrote:
> On 10 June 2013 17:05, Tushar Behera <[email protected]> wrote:
>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> introduced devm_ioremap_resource() and deprecated the use of
>> devm_request_and_ioremap().
>
> This patch does a little more than just conversion. May that change
> could be mentioned here.
>

Sure. I will update that.

>>
>> Signed-off-by: Tushar Behera <[email protected]>
>> CC: [email protected]
>> CC: Liam Girdwood <[email protected]>
>> CC: Mark Brown <[email protected]>
>> ---
>> sound/soc/spear/spdif_out.c | 20 +++++---------------
>> 1 file changed, 5 insertions(+), 15 deletions(-)
>>
>> diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
>> index 4bde512..896ee7f 100644
>> --- a/sound/soc/spear/spdif_out.c
>> +++ b/sound/soc/spear/spdif_out.c
>> @@ -282,27 +282,17 @@ static int spdif_out_probe(struct platform_device *pdev)
>> struct resource *res;
>> int ret;
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> - if (!res)
>> - return -EINVAL;
>> -
>> - if (!devm_request_mem_region(&pdev->dev, res->start,
>> - resource_size(res), pdev->name)) {
>> - dev_warn(&pdev->dev, "Failed to get memory resourse\n");
>> - return -ENOENT;
>> - }
>> -
>> host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
>> if (!host) {
>> dev_warn(&pdev->dev, "kzalloc fail\n");
>> return -ENOMEM;
>> }
>>
>> - host->io_base = devm_request_and_ioremap(&pdev->dev, res->start,
>> - resource_size(res));
>> - if (!host->io_base) {
>> - dev_warn(&pdev->dev, "ioremap failed\n");
>> - return -ENOMEM;
>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> + host->io_base = devm_ioremap_resource(&pdev->dev, res);
>> + if (IS_ERR(host->io_base)) {
>> + dev_warn(&pdev->dev, "devm_ioremap_resource failed\n");
>
> This print is not needed as devm_ioremap_resource prints its own messages.
>
>

Ok.

Thanks.

--
Tushar Behera

2013-06-11 04:31:31

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On 06/10/2013 05:31 PM, Sachin Kamat wrote:
> On 10 June 2013 17:05, Tushar Behera <[email protected]> wrote:
>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> introduced devm_ioremap_resource() and deprecated the use of
>> devm_request_and_ioremap().
>>
>> Signed-off-by: Tushar Behera <[email protected]>
>> CC: Mark Brown <[email protected]>
>> CC: Liam Girdwood <[email protected]>
>> ---
>> drivers/regulator/ti-abb-regulator.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
>> index 870d209..f494a11 100644
>> --- a/drivers/regulator/ti-abb-regulator.c
>> +++ b/drivers/regulator/ti-abb-regulator.c
>> @@ -722,10 +722,10 @@ static int ti_abb_probe(struct platform_device *pdev)
>> ret = -ENODEV;
>> goto err;
>> }
>> - abb->base = devm_request_and_ioremap(dev, res);
>> - if (!abb->base) {
>> + abb->base = devm_ioremap_resource(dev, res);
>> + if (IS_ERR(abb->base)) {
>> dev_err(dev, "Unable to map '%s'\n", pname);
>
> You may remove the above error message as devm_ioremap_resource prints
> its own error messages.
>

There are a few other error messages in the driver (related to
devm_ioremap_nocache) in the same format. I would prefer to leave this
error message right now.

>> - ret = -ENOMEM;
>> + ret = PTR_ERR(abb->base);
>> goto err;
>> }
>>
>> @@ -776,10 +776,10 @@ static int ti_abb_probe(struct platform_device *pdev)
>> ret = -ENODEV;
>> goto skip_opt;
>> }
>> - abb->ldo_base = devm_request_and_ioremap(dev, res);
>> - if (!abb->ldo_base) {
>> + abb->ldo_base = devm_ioremap_resource(dev, res);
>> + if (IS_ERR(abb->ldo_base)) {
>> dev_err(dev, "Unable to map '%s'\n", pname);
>
> ditto
>

Same as above.

Thanks.

--
Tushar Behera

2013-06-11 04:52:05

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 13/15] pci: mvebu: Convert to use devm_ioremap_resource

On 06/10/2013 07:59 PM, Sachin Kamat wrote:
> On 10 June 2013 17:05, Tushar Behera <[email protected]> wrote:
>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> introduced devm_ioremap_resource() and deprecated the use of
>> devm_request_and_ioremap().
>>
>> Signed-off-by: Tushar Behera <[email protected]>
>> CC: [email protected]
>> CC: Bjorn Helgaas <[email protected]>
>> ---
>> drivers/pci/host/pci-mvebu.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
>> index 13a633b..e714876 100644
>> --- a/drivers/pci/host/pci-mvebu.c
>> +++ b/drivers/pci/host/pci-mvebu.c
>> @@ -752,7 +752,7 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
>> if (ret)
>> return NULL;
>>
>> - return devm_request_and_ioremap(&pdev->dev, &regs);
>> + return devm_ioremap_resource(&pdev->dev, &regs);
>> }
>>
>> static int __init mvebu_pcie_probe(struct platform_device *pdev)
>> @@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
>> continue;
>>
>> port->base = mvebu_pcie_map_registers(pdev, child, port);
>> - if (!port->base) {
>> + if (IS_ERR(port->base)) {
>> dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
>> port->port, port->lane);
>
> This error message is redundant.
>

It provides a little more information regarding the port and lane number
which might be useful in debugging.

>> + port->base = NULL;
> Probably this is also not needed.
>

I was not sure about the default error value for port->base, hence I
replicated the old behaviour.

Thanks.
--
Tushar Behera

2013-06-12 03:09:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

On Tue, Jun 11, 2013 at 08:45:47AM +0530, Tushar Behera wrote:
> +CC: 'Greg Kroah-Hartman' <[email protected]>
>
> On 06/10/2013 06:39 PM, Marc Kleine-Budde wrote:
> > On 06/10/2013 01:35 PM, Tushar Behera wrote:
> >> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> >> introduced devm_ioremap_resource() and deprecated the use of
> >> devm_request_and_ioremap().
> >
> > Acked-by: Marc Kleine-Budde <[email protected]>
> >
> > Are the patches going over the individual subsystem maintainers?
> >
> > Marc
> >
>
> I am not sure. Looping in Greg for clarity.

I'm taking the ones for my subsystem(s), the last one should probably go
in after 3.11-rc1 is released, in order to ensure no remaining in-tree
users of the function are still around.

thanks,

greg k-h

2013-06-12 09:23:28

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 06/15] net: bcm63xx_enet: Convert to use devm_ioremap_resource

From: Tushar Behera <[email protected]>
Date: Mon, 10 Jun 2013 17:05:04 +0530

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>

In net-next, the driver is already using devm_ioremap_resource().

2013-06-12 09:23:51

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 07/15] net: fec: Convert to use devm_ioremap_resource

From: Tushar Behera <[email protected]>
Date: Mon, 10 Jun 2013 17:05:05 +0530

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>

Applied.

2013-06-12 09:23:57

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 08/15] net: emaclite: Convert to use devm_ioremap_resource

From: Tushar Behera <[email protected]>
Date: Mon, 10 Jun 2013 17:05:06 +0530

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>

Applied.

2013-06-12 09:24:08

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

From: Tushar Behera <[email protected]>
Date: Mon, 10 Jun 2013 17:05:07 +0530

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>

Applied.

2013-06-12 12:44:01

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 15/15] lib: devres: Remove deprecated devm_request_and_ioremap

On Mon, Jun 10, 2013 at 2:35 PM, Tushar Behera <[email protected]> wrote:
> Now that all the users of devm_request_and_ioremap have been converted
> to use devm_ioremap_resource, remove the definition.

This is a function which was exported to the drivers including
third-party drivers.
I suggest to mark it as __deprecated and wait couple of release cycles.



--
With Best Regards,
Andy Shevchenko

2013-06-12 17:39:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 15/15] lib: devres: Remove deprecated devm_request_and_ioremap

On Wed, Jun 12, 2013 at 03:43:59PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 10, 2013 at 2:35 PM, Tushar Behera <[email protected]> wrote:
> > Now that all the users of devm_request_and_ioremap have been converted
> > to use devm_ioremap_resource, remove the definition.
>
> This is a function which was exported to the drivers including
> third-party drivers.

That doesn't matter, we've cleaned up all in-kernel users of it, so we
can safely delete it.

> I suggest to mark it as __deprecated and wait couple of release cycles.

No, that's not going to help anyone, just delete it and move on.

thanks,

greg k-h

2013-06-13 05:30:14

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

On 06/10/2013 05:05 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: [email protected]
> CC: Marc Kleine-Budde <[email protected]>
> CC: Wolfgang Grandegger <[email protected]>
> ---
> drivers/net/can/c_can/c_can_platform.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
> index 6b6130b..b918c73 100644
> --- a/drivers/net/can/c_can/c_can_platform.c
> +++ b/drivers/net/can/c_can/c_can_platform.c
> @@ -201,8 +201,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
> priv->instance = pdev->id;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - priv->raminit_ctrlreg = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->raminit_ctrlreg || priv->instance < 0)
> + priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
> dev_info(&pdev->dev, "control memory is not used for raminit\n");
> else
> priv->raminit = c_can_hw_raminit;
>

IS_ERR() check on the return value of devm_ioremap_resource produces
following sparse warning. This is because of the __iomem address space
attribute. How should we fix this?

drivers/net/can/c_can/c_can_platform.c:205:32: warning: incorrect type
in argument 1 (different address spaces)
drivers/net/can/c_can/c_can_platform.c:205:32: expected void const *ptr
drivers/net/can/c_can/c_can_platform.c:205:32: got unsigned int
[noderef] [usertype] <asn:2>*raminit_ctrlreg


--
Tushar Behera

2013-06-13 05:41:12

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

On 13 June 2013 11:00, Tushar Behera <[email protected]> wrote:
> On 06/10/2013 05:05 PM, Tushar Behera wrote:
>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> introduced devm_ioremap_resource() and deprecated the use of
>> devm_request_and_ioremap().
>>
>> Signed-off-by: Tushar Behera <[email protected]>
>> CC: [email protected]
>> CC: [email protected]
>> CC: Marc Kleine-Budde <[email protected]>
>> CC: Wolfgang Grandegger <[email protected]>
>> ---
>> drivers/net/can/c_can/c_can_platform.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
>> index 6b6130b..b918c73 100644
>> --- a/drivers/net/can/c_can/c_can_platform.c
>> +++ b/drivers/net/can/c_can/c_can_platform.c
>> @@ -201,8 +201,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
>> priv->instance = pdev->id;
>>
>> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>> - priv->raminit_ctrlreg = devm_request_and_ioremap(&pdev->dev, res);
>> - if (!priv->raminit_ctrlreg || priv->instance < 0)
>> + priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res);
>> + if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
>> dev_info(&pdev->dev, "control memory is not used for raminit\n");
>> else
>> priv->raminit = c_can_hw_raminit;
>>
>
> IS_ERR() check on the return value of devm_ioremap_resource produces
> following sparse warning. This is because of the __iomem address space
> attribute. How should we fix this?
>
> drivers/net/can/c_can/c_can_platform.c:205:32: warning: incorrect type
> in argument 1 (different address spaces)
> drivers/net/can/c_can/c_can_platform.c:205:32: expected void const *ptr
> drivers/net/can/c_can/c_can_platform.c:205:32: got unsigned int
> [noderef] [usertype] <asn:2>*raminit_ctrlreg
>

This is a known issue since the time devm_ioremap_resource was
introduced. Thierry had already submitted some fixes for this.
I am not sure if they have been applied yet.
More details here:
https://patchwork.kernel.org/patch/2071361/

--
With warm regards,
Sachin

2013-06-17 06:11:43

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 02/15] sudmac: Convert to use devm_ioremap_resource

On 06/10/2013 05:05 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: Vinod Koul <[email protected]>
> CC: Dan Williams <[email protected]>
> ---
> drivers/dma/sh/sudmac.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
> index e7c94bb..0a81e30 100644
> --- a/drivers/dma/sh/sudmac.c
> +++ b/drivers/dma/sh/sudmac.c
> @@ -360,9 +360,9 @@ 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;
> + 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);
>
>

Ping.

--
Tushar Behera

2013-06-17 06:12:31

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 03/15] mmc: mvsdio: Convert to use devm_ioremap_resource

On 06/10/2013 05:05 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Chris Ball <[email protected]>
> ---
> drivers/mmc/host/mvsdio.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> index d08fe6a..656f1f5 100644
> --- a/drivers/mmc/host/mvsdio.c
> +++ b/drivers/mmc/host/mvsdio.c
> @@ -758,9 +758,9 @@ 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;
> + host->base = devm_ioremap_resource(&pdev->dev, r);
> + if (IS_ERR(host->base)) {
> + ret = PTR_ERR(host->base);
> goto out;
> }
>
>

Ping.

--
Tushar Behera

2013-06-17 06:13:28

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 04/15] gpio_msm: Convert to use devm_ioremap_resource

On 06/10/2013 05:05 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Linus Walleij <[email protected]>
> CC: Grant Likely <[email protected]>
> ---
> drivers/gpio/gpio-msm-v1.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
> index c798585a..c0ead43 100644
> --- a/drivers/gpio/gpio-msm-v1.c
> +++ b/drivers/gpio/gpio-msm-v1.c
> @@ -652,14 +652,14 @@ static int __devinit gpio_msm_v1_probe(struct platform_device *pdev)
> return irq2;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - base1 = devm_request_and_ioremap(&pdev->dev, res);
> - if (!base1)
> - return -EADDRNOTAVAIL;
> + base1 = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(base1))
> + return PTR_ERR(base1);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - base2 = devm_request_and_ioremap(&pdev->dev, res);
> - if (!base2)
> - return -EADDRNOTAVAIL;
> + base2 = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(base2))
> + return PTR_ERR(base2);
>
> for (i = FIRST_GPIO_IRQ; i < FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) {
> if (i - FIRST_GPIO_IRQ >=
>

Ping.

--
Tushar Behera

2013-06-17 06:13:46

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 05/15] gpio-sta2x11: Convert to use devm_ioremap_resource

On 06/10/2013 05:05 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Grant Likely <[email protected]>
> CC: Linus Walleij <[email protected]>
> ---
> drivers/gpio/gpio-sta2x11.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
> index 5585425..c977c14 100644
> --- a/drivers/gpio/gpio-sta2x11.c
> +++ b/drivers/gpio/gpio-sta2x11.c
> @@ -372,7 +372,9 @@ static int gsta_probe(struct platform_device *dev)
>
> chip = devm_kzalloc(&dev->dev, sizeof(*chip), GFP_KERNEL);
> chip->dev = &dev->dev;
> - chip->reg_base = devm_request_and_ioremap(&dev->dev, res);
> + chip->reg_base = devm_ioremap_resource(&dev->dev, res);
> + if (IS_ERR(chip->reg_base))
> + return PTR_ERR(chip->reg_base);
>
> for (i = 0; i < GSTA_NR_BLOCKS; i++) {
> chip->regs[i] = chip->reg_base + i * 4096;
>

Ping.

--
Tushar Behera

2013-06-17 08:54:12

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 05/15] gpio-sta2x11: Convert to use devm_ioremap_resource

On Mon, Jun 10, 2013 at 1:35 PM, Tushar Behera <[email protected]> wrote:

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Grant Likely <[email protected]>
> CC: Linus Walleij <[email protected]>

Patch applied.

Yours,
Linus Walleij

2013-06-17 09:12:33

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On 06/10/2013 05:05 PM, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: Mark Brown <[email protected]>
> CC: Liam Girdwood <[email protected]>
> ---
> drivers/regulator/ti-abb-regulator.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
> index 870d209..f494a11 100644
> --- a/drivers/regulator/ti-abb-regulator.c
> +++ b/drivers/regulator/ti-abb-regulator.c
> @@ -722,10 +722,10 @@ static int ti_abb_probe(struct platform_device *pdev)
> ret = -ENODEV;
> goto err;
> }
> - abb->base = devm_request_and_ioremap(dev, res);
> - if (!abb->base) {
> + abb->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(abb->base)) {
> dev_err(dev, "Unable to map '%s'\n", pname);
> - ret = -ENOMEM;
> + ret = PTR_ERR(abb->base);
> goto err;
> }
>
> @@ -776,10 +776,10 @@ static int ti_abb_probe(struct platform_device *pdev)
> ret = -ENODEV;
> goto skip_opt;
> }
> - abb->ldo_base = devm_request_and_ioremap(dev, res);
> - if (!abb->ldo_base) {
> + abb->ldo_base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(abb->ldo_base)) {
> dev_err(dev, "Unable to map '%s'\n", pname);
> - ret = -ENOMEM;
> + ret = PTR_ERR(abb->ldo_base);
> goto err;
> }
>
>

Ping.

--
Tushar Behera

2013-06-17 09:22:30

by Tushar Behera

[permalink] [raw]
Subject: [PATCH V2 1/15] sparc,leon: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

While at it, also remove the error message as devm_ioremap_resource()
also prints similar error message.

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: "David S. Miller" <[email protected]>
---
Changes for V2:
* Removed redundant error message.

arch/sparc/kernel/leon_pci_grpci1.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
index 7739a54..6df26e3 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -536,11 +536,9 @@ static int grpci1_of_probe(struct platform_device *ofdev)

/* find device register base address */
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
- regs = devm_request_and_ioremap(&ofdev->dev, res);
- if (!regs) {
- dev_err(&ofdev->dev, "io-regs mapping failed\n");
- return -EADDRNOTAVAIL;
- }
+ regs = devm_ioremap_resource(&ofdev->dev, res);
+ if (IS_ERR(regs))
+ return PTR_ERR(regs);

/*
* check that we're in Host Slot and that we can act as a Host Bridge
--
1.7.9.5

2013-06-17 09:28:03

by Tushar Behera

[permalink] [raw]
Subject: [PATCH V2 12/15] ASoC: spear: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

devm_request_mem_region is called in devm_ioremap_resource(). Hence that
part can also be removed.

Since devm_ioremap_resource prints error message on failure, there is
no need to print an explicit warning message.

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Liam Girdwood <[email protected]>
CC: Mark Brown <[email protected]>
---
Changes for V2:
* Removed redundant print of error message from devm_ioremap_resource
exit path
* Call to devm_request_mem_region is removed.

sound/soc/spear/spdif_out.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index 4bde512..64db05a 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -282,28 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev)
struct resource *res;
int ret;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
-
- if (!devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name)) {
- dev_warn(&pdev->dev, "Failed to get memory resourse\n");
- return -ENOENT;
- }
-
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
if (!host) {
dev_warn(&pdev->dev, "kzalloc fail\n");
return -ENOMEM;
}

- host->io_base = devm_request_and_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!host->io_base) {
- dev_warn(&pdev->dev, "ioremap failed\n");
- return -ENOMEM;
- }
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ host->io_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(host->io_base))
+ return PTR_ERR(host->io_base);

host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(host->clk))
--
1.7.9.5

2013-06-17 09:31:04

by Tushar Behera

[permalink] [raw]
Subject: [PATCH V2 6/6] pci: mvebu: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

While at it, modify mvebu_pcie_map_registers() to propagate error code.

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Bjorn Helgaas <[email protected]>
---
Changes for V2:
* Return proper error code in mvebu_pcie_map_registers.

drivers/pci/host/pci-mvebu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 13a633b..8fc2a82 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -750,9 +750,9 @@ mvebu_pcie_map_registers(struct platform_device *pdev,

ret = of_address_to_resource(np, 0, &regs);
if (ret)
- return NULL;
+ return ERR_PTR(ret);

- return devm_request_and_ioremap(&pdev->dev, &regs);
+ return devm_ioremap_resource(&pdev->dev, &regs);
}

static int __init mvebu_pcie_probe(struct platform_device *pdev)
@@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
continue;

port->base = mvebu_pcie_map_registers(pdev, child, port);
- if (!port->base) {
+ if (IS_ERR(port->base)) {
dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
port->port, port->lane);
+ port->base = NULL;
continue;
}

--
1.7.9.5

2013-06-17 10:05:32

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On Mon, Jun 17, 2013 at 02:42:25PM +0530, Tushar Behera wrote:
> On 06/10/2013 05:05 PM, Tushar Behera wrote:
> > Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> > introduced devm_ioremap_resource() and deprecated the use of
> > devm_request_and_ioremap().

> Ping.

Don't send contentless pings. I seem to recall you already got some
review on this.


Attachments:
(No filename) (377.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-06-17 10:20:04

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH V2 12/15] ASoC: spear: Convert to use devm_ioremap_resource

On Mon, Jun 17, 2013 at 02:43:08PM +0530, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().

This doesn't apply against current code, please check and resend.


Attachments:
(No filename) (296.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-06-17 10:34:58

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On 06/17/2013 03:35 PM, Mark Brown wrote:
> On Mon, Jun 17, 2013 at 02:42:25PM +0530, Tushar Behera wrote:
>> On 06/10/2013 05:05 PM, Tushar Behera wrote:
>>> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>>> introduced devm_ioremap_resource() and deprecated the use of
>>> devm_request_and_ioremap().
>
>> Ping.
>
> Don't send contentless pings. I seem to recall you already got some
> review on this.
>

The comment was on removal of the error message during
devm_ioremap_resource() error check . Since there are a few other error
messages in the driver (related to devm_ioremap_nocache) in the same
format, I prefer to leave this error message right now.

There were no other comments.

--
Tushar Behera

2013-06-17 10:55:45

by Tushar Behera

[permalink] [raw]
Subject: [PATCH V3 12/15] ASoC: spear: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

devm_request_mem_region is called in devm_ioremap_resource(). Hence that
part can also be removed.

Since devm_ioremap_resource prints error message on failure, there is
no need to print an explicit warning message.

Signed-off-by: Tushar Behera <[email protected]>
CC: [email protected]
CC: Liam Girdwood <[email protected]>
CC: Mark Brown <[email protected]>
---
Changes for V3:
* Rebased on for-next branch of sound/soc git tree
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

Changes for V2:
* Removed redundant print of error message from devm_ioremap_resource
exit path
* Call to devm_request_mem_region is removed.

sound/soc/spear/spdif_out.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index a4a8748..2fdf68c 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -282,27 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev)
struct resource *res;
int ret;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
-
- if (!devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name)) {
- dev_warn(&pdev->dev, "Failed to get memory resourse\n");
- return -ENOENT;
- }
-
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
if (!host) {
dev_warn(&pdev->dev, "kzalloc fail\n");
return -ENOMEM;
}

- host->io_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!host->io_base) {
- dev_warn(&pdev->dev, "ioremap failed\n");
- return -ENOMEM;
- }
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ host->io_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(host->io_base))
+ return PTR_ERR(host->io_base);

host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(host->clk))
--
1.7.9.5

2013-06-17 16:09:01

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On Mon, Jun 17, 2013 at 04:04:52PM +0530, Tushar Behera wrote:
> On 06/17/2013 03:35 PM, Mark Brown wrote:
> > On Mon, Jun 17, 2013 at 02:42:25PM +0530, Tushar Behera wrote:

> >> Ping.
i
> > Don't send contentless pings. I seem to recall you already got some
> > review on this.

>
> The comment was on removal of the error message during
> devm_ioremap_resource() error check . Since there are a few other error
> messages in the driver (related to devm_ioremap_nocache) in the same
> format, I prefer to leave this error message right now.

So we should say the same thing repeatedly? That seems silly. That
seems silly. It's like the contentless pings issue...


Attachments:
(No filename) (671.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-06-17 16:20:36

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH V3 12/15] ASoC: spear: Convert to use devm_ioremap_resource

On Mon, Jun 17, 2013 at 04:10:57PM +0530, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().

Applied, thanks.


Attachments:
(No filename) (247.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-06-17 19:45:20

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On Mon, Jun 17, 2013 at 05:08:53PM +0100, Mark Brown wrote:
> On Mon, Jun 17, 2013 at 04:04:52PM +0530, Tushar Behera wrote:
> > On 06/17/2013 03:35 PM, Mark Brown wrote:
> > > On Mon, Jun 17, 2013 at 02:42:25PM +0530, Tushar Behera wrote:
>
> > >> Ping.
> i
> > > Don't send contentless pings. I seem to recall you already got some
> > > review on this.
>
> >
> > The comment was on removal of the error message during
> > devm_ioremap_resource() error check . Since there are a few other error
> > messages in the driver (related to devm_ioremap_nocache) in the same
> > format, I prefer to leave this error message right now.
>
> So we should say the same thing repeatedly? That seems silly. That
> seems silly. It's like the contentless pings issue...

The intention was to make resource usage more consistent with the new
devm_ioremap_resource(). Part of the consistency involved to move all
error messages into the function so that callers shouldn't have to
worry about them anymore.

So I agree with Mark that there's really no use in keeping a second copy
of the error message.

Thierry


Attachments:
(No filename) (1.08 kB)
(No filename) (836.00 B)
Download all attachments

2013-06-18 04:29:55

by Tushar Behera

[permalink] [raw]
Subject: [PATCH V2 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

While at it, remove the error message as devm_ioremap_resource prints a similar
error message.

Signed-off-by: Tushar Behera <[email protected]>
CC: Mark Brown <[email protected]>
CC: Liam Girdwood <[email protected]>
---
Changes for V2:
* Removed error messages from devm_ioremap_resource exit path

drivers/regulator/ti-abb-regulator.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
index 870d209..3753ed0 100644
--- a/drivers/regulator/ti-abb-regulator.c
+++ b/drivers/regulator/ti-abb-regulator.c
@@ -722,10 +722,9 @@ static int ti_abb_probe(struct platform_device *pdev)
ret = -ENODEV;
goto err;
}
- abb->base = devm_request_and_ioremap(dev, res);
- if (!abb->base) {
- dev_err(dev, "Unable to map '%s'\n", pname);
- ret = -ENOMEM;
+ abb->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(abb->base)) {
+ ret = PTR_ERR(abb->base);
goto err;
}

@@ -776,10 +775,9 @@ static int ti_abb_probe(struct platform_device *pdev)
ret = -ENODEV;
goto skip_opt;
}
- abb->ldo_base = devm_request_and_ioremap(dev, res);
- if (!abb->ldo_base) {
- dev_err(dev, "Unable to map '%s'\n", pname);
- ret = -ENOMEM;
+ abb->ldo_base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(abb->ldo_base)) {
+ ret = PTR_ERR(abb->ldo_base);
goto err;
}

--
1.7.9.5

2013-06-18 11:59:23

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH V2 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

On Tue, Jun 18, 2013 at 09:45:07AM +0530, Tushar Behera wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().

I've applied this. In future please do remember that if you're not
sending a patch series you shouldn't mark it as being part of one,
people will only wonder where the rest of the series is and miss things.
You haven't sent me 15 patches, you've sent me a single patch.


Attachments:
(No filename) (501.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-06-19 09:14:56

by David Miller

[permalink] [raw]
Subject: Re: [PATCH V2 1/15] sparc,leon: Convert to use devm_ioremap_resource

From: Tushar Behera <[email protected]>
Date: Mon, 17 Jun 2013 14:37:44 +0530

> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> While at it, also remove the error message as devm_ioremap_resource()
> also prints similar error message.
>
> Signed-off-by: Tushar Behera <[email protected]>

Applied.

2013-07-23 18:39:04

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH V2 6/6] pci: mvebu: Convert to use devm_ioremap_resource

[+cc Thomas]

On Mon, Jun 17, 2013 at 3:16 AM, Tushar Behera <[email protected]> wrote:
> Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> introduced devm_ioremap_resource() and deprecated the use of
> devm_request_and_ioremap().
>
> While at it, modify mvebu_pcie_map_registers() to propagate error code.
>
> Signed-off-by: Tushar Behera <[email protected]>
> CC: [email protected]
> CC: Bjorn Helgaas <[email protected]>

Acked-by: Bjorn Helgaas <[email protected]>

Thomas has a bunch of mvebu patches in the pipeline, so I assume he
will incorporate this if appropriate. I don't want to put it in my
tree and cause conflicts with his changes. Let me know if I should do
something else here.

Bjorn

> ---
> Changes for V2:
> * Return proper error code in mvebu_pcie_map_registers.
>
> drivers/pci/host/pci-mvebu.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> index 13a633b..8fc2a82 100644
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -750,9 +750,9 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
>
> ret = of_address_to_resource(np, 0, &regs);
> if (ret)
> - return NULL;
> + return ERR_PTR(ret);
>
> - return devm_request_and_ioremap(&pdev->dev, &regs);
> + return devm_ioremap_resource(&pdev->dev, &regs);
> }
>
> static int __init mvebu_pcie_probe(struct platform_device *pdev)
> @@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
> continue;
>
> port->base = mvebu_pcie_map_registers(pdev, child, port);
> - if (!port->base) {
> + if (IS_ERR(port->base)) {
> dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
> port->port, port->lane);
> + port->base = NULL;
> continue;
> }
>
> --
> 1.7.9.5
>

2013-07-23 20:19:54

by Ezequiel Garcia

[permalink] [raw]
Subject: Re: [PATCH V2 6/6] pci: mvebu: Convert to use devm_ioremap_resource

On Tue, Jul 23, 2013 at 12:38:28PM -0600, Bjorn Helgaas wrote:
> [+cc Thomas]
>
> On Mon, Jun 17, 2013 at 3:16 AM, Tushar Behera <[email protected]> wrote:
> > Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> > introduced devm_ioremap_resource() and deprecated the use of
> > devm_request_and_ioremap().
> >
> > While at it, modify mvebu_pcie_map_registers() to propagate error code.
> >
> > Signed-off-by: Tushar Behera <[email protected]>
> > CC: [email protected]
> > CC: Bjorn Helgaas <[email protected]>
>
> Acked-by: Bjorn Helgaas <[email protected]>
>

Acked-by: Ezequiel Garcia <[email protected]>A

> Thomas has a bunch of mvebu patches in the pipeline, so I assume he
> will incorporate this if appropriate. I don't want to put it in my
> tree and cause conflicts with his changes. Let me know if I should do
> something else here.
>

We have the MBus DT patches, to say the least.
Not sure if it conflicts with this and how we should handle it in that
case.

Jason, any ideas?
--
Ezequiel GarcĂ­a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

2013-08-06 10:39:52

by Thomas Petazzoni

[permalink] [raw]
Subject: Re: [PATCH V2 6/6] pci: mvebu: Convert to use devm_ioremap_resource

Dear Bjorn Helgaas,

[+cc Jason Cooper, Gregory Clement and Ezequiel Garcia]

On Tue, 23 Jul 2013 12:38:28 -0600, Bjorn Helgaas wrote:
> [+cc Thomas]
>
> On Mon, Jun 17, 2013 at 3:16 AM, Tushar Behera <[email protected]> wrote:
> > Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
> > introduced devm_ioremap_resource() and deprecated the use of
> > devm_request_and_ioremap().
> >
> > While at it, modify mvebu_pcie_map_registers() to propagate error code.
> >
> > Signed-off-by: Tushar Behera <[email protected]>
> > CC: [email protected]
> > CC: Bjorn Helgaas <[email protected]>
>
> Acked-by: Bjorn Helgaas <[email protected]>
>
> Thomas has a bunch of mvebu patches in the pipeline, so I assume he
> will incorporate this if appropriate. I don't want to put it in my
> tree and cause conflicts with his changes. Let me know if I should do
> something else here.

I don't really have that many pci-mvebu.c patches in the pipeline
actually. The only one I have is to enable MSI support, and it's a
fairly light one that should not conflict too badly with this one.

Therefore, Bjorn, I believe this patch could go through your tree,
either for 3.11 or 3.12 as you prefer.

Best regards,

Thomas Petazzoni
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

2013-08-06 18:10:48

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH V2 6/6] pci: mvebu: Convert to use devm_ioremap_resource

On Tue, Aug 6, 2013 at 4:39 AM, Thomas Petazzoni
<[email protected]> wrote:
> Dear Bjorn Helgaas,
>
> [+cc Jason Cooper, Gregory Clement and Ezequiel Garcia]
>
> On Tue, 23 Jul 2013 12:38:28 -0600, Bjorn Helgaas wrote:
>> [+cc Thomas]
>>
>> On Mon, Jun 17, 2013 at 3:16 AM, Tushar Behera <[email protected]> wrote:
>> > Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
>> > introduced devm_ioremap_resource() and deprecated the use of
>> > devm_request_and_ioremap().
>> >
>> > While at it, modify mvebu_pcie_map_registers() to propagate error code.
>> >
>> > Signed-off-by: Tushar Behera <[email protected]>
>> > CC: [email protected]
>> > CC: Bjorn Helgaas <[email protected]>
>>
>> Acked-by: Bjorn Helgaas <[email protected]>
>>
>> Thomas has a bunch of mvebu patches in the pipeline, so I assume he
>> will incorporate this if appropriate. I don't want to put it in my
>> tree and cause conflicts with his changes. Let me know if I should do
>> something else here.
>
> I don't really have that many pci-mvebu.c patches in the pipeline
> actually. The only one I have is to enable MSI support, and it's a
> fairly light one that should not conflict too badly with this one.
>
> Therefore, Bjorn, I believe this patch could go through your tree,
> either for 3.11 or 3.12 as you prefer.

Added to pci/misc for v3.12. Thanks.

Bjorn