linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource()
@ 2019-03-12  9:19 Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 2/9] drivers: ata: ahci_seattle: " Enrico Weigelt, metux IT consult
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/ahci_octeon.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ata/ahci_octeon.c b/drivers/ata/ahci_octeon.c
index 5a44e08..2280180 100644
--- a/drivers/ata/ahci_octeon.c
+++ b/drivers/ata/ahci_octeon.c
@@ -32,13 +32,11 @@ static int ahci_octeon_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *node = dev->of_node;
-	struct resource *res;
 	void __iomem *base;
 	u64 cfg;
 	int ret;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
1.9.1

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

* [PATCH 2/9] drivers: ata: ahci_seattle: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 3/9] drivers: ata: ahci_tegra: " Enrico Weigelt, metux IT consult
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/ahci_seattle.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c
index e57b6f9..9a10d81 100644
--- a/drivers/ata/ahci_seattle.c
+++ b/drivers/ata/ahci_seattle.c
@@ -140,8 +140,7 @@ static const struct ata_port_info *ahci_seattle_get_port_info(
 	if (!plat_data)
 		return &ahci_port_info;
 
-	plat_data->sgpio_ctrl = devm_ioremap_resource(dev,
-			      platform_get_resource(pdev, IORESOURCE_MEM, 1));
+	plat_data->sgpio_ctrl = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(plat_data->sgpio_ctrl))
 		return &ahci_port_info;
 
-- 
1.9.1

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

* [PATCH 3/9] drivers: ata: ahci_tegra: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 2/9] drivers: ata: ahci_seattle: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12 10:04   ` Jon Hunter
  2019-03-12  9:19 ` [PATCH 4/9] drivers: ata: ahci_xgene: " Enrico Weigelt, metux IT consult
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/ahci_tegra.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
index 004f260..88748ca 100644
--- a/drivers/ata/ahci_tegra.c
+++ b/drivers/ata/ahci_tegra.c
@@ -490,7 +490,6 @@ static int tegra_ahci_probe(struct platform_device *pdev)
 {
 	struct ahci_host_priv *hpriv;
 	struct tegra_ahci_priv *tegra;
-	struct resource *res;
 	int ret;
 	unsigned int i;
 
@@ -507,19 +506,17 @@ static int tegra_ahci_probe(struct platform_device *pdev)
 	tegra->pdev = pdev;
 	tegra->soc = of_device_get_match_data(&pdev->dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res);
+	tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(tegra->sata_regs))
 		return PTR_ERR(tegra->sata_regs);
 
 	/*
 	 * AUX registers is optional.
 	 */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	if (res) {
-		tegra->sata_aux_regs = devm_ioremap_resource(&pdev->dev, res);
-		if (IS_ERR(tegra->sata_aux_regs))
-			return PTR_ERR(tegra->sata_aux_regs);
+	tegra->sata_aux_regs = devm_platform_ioremap_resource(pdev, 2);
+	if (IS_ERR(tegra->sata_aux_regs)) {
+		dev_info(&pdev->dev, "Cant get aux registers (optional)");
+		tegra->sata_aux_regs = NULL;
 	}
 
 	tegra->sata_rst = devm_reset_control_get(&pdev->dev, "sata");
-- 
1.9.1

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

* [PATCH 4/9] drivers: ata: ahci_xgene: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 2/9] drivers: ata: ahci_seattle: " Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 3/9] drivers: ata: ahci_tegra: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12 14:43   ` Sergei Shtylyov
  2019-03-12  9:19 ` [PATCH 5/9] drivers: ata: libahci_platform: " Enrico Weigelt, metux IT consult
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/ahci_xgene.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 7e157e1..99c622c 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -752,7 +752,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct ahci_host_priv *hpriv;
 	struct xgene_ahci_context *ctx;
-	struct resource *res;
 	const struct of_device_id *of_devid;
 	enum xgene_ahci_version version = XGENE_AHCI_V1;
 	const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info,
@@ -772,31 +771,25 @@ static int xgene_ahci_probe(struct platform_device *pdev)
 	ctx->dev = dev;
 
 	/* Retrieve the IP core resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	ctx->csr_core = devm_ioremap_resource(dev, res);
+	ctx->csr_core = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(ctx->csr_core))
 		return PTR_ERR(ctx->csr_core);
 
 	/* Retrieve the IP diagnostic resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	ctx->csr_diag = devm_ioremap_resource(dev, res);
+	ctx->csr_diag = devm_platform_ioremap_resource(pdev, 2);
 	if (IS_ERR(ctx->csr_diag))
 		return PTR_ERR(ctx->csr_diag);
 
 	/* Retrieve the IP AXI resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
-	ctx->csr_axi = devm_ioremap_resource(dev, res);
+	ctx->csr_axi = devm_platform_ioremap_resource(pdev, 3);
 	if (IS_ERR(ctx->csr_axi))
 		return PTR_ERR(ctx->csr_axi);
 
 	/* Retrieve the optional IP mux resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
-	if (res) {
-		void __iomem *csr = devm_ioremap_resource(dev, res);
-		if (IS_ERR(csr))
-			return PTR_ERR(csr);
-
-		ctx->csr_mux = csr;
+	ctx->csr_mux = csr = devm_platform_ioremap_resource(pdev, 4);
+	if (IS_ERR(ctx->csr_mux)) {
+		dev_info(&pdev->dev, "cant get ip mux resource (optional)");
+		ctx->csr_mux = NULL;
 	}
 
 	of_devid = of_match_device(xgene_ahci_of_match, dev);
-- 
1.9.1

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

* [PATCH 5/9] drivers: ata: libahci_platform: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
                   ` (2 preceding siblings ...)
  2019-03-12  9:19 ` [PATCH 4/9] drivers: ata: ahci_xgene: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 6/9] drivers: ata: pata_bk3710: " Enrico Weigelt, metux IT consult
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/libahci_platform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 81b1a33..8dc8b9a 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -409,8 +409,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
 
 	devres_add(dev, hpriv);
 
-	hpriv->mmio = devm_ioremap_resource(dev,
-			      platform_get_resource(pdev, IORESOURCE_MEM, 0));
+	hpriv->mmio = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hpriv->mmio)) {
 		dev_err(dev, "no mmio space\n");
 		rc = PTR_ERR(hpriv->mmio);
-- 
1.9.1

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

* [PATCH 6/9] drivers: ata: pata_bk3710: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
                   ` (3 preceding siblings ...)
  2019-03-12  9:19 ` [PATCH 5/9] drivers: ata: libahci_platform: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 7/9] drivers: ata: sata_dwc_460ex: " Enrico Weigelt, metux IT consult
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/pata_bk3710.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/ata/pata_bk3710.c b/drivers/ata/pata_bk3710.c
index fad95cf..92b036d 100644
--- a/drivers/ata/pata_bk3710.c
+++ b/drivers/ata/pata_bk3710.c
@@ -291,7 +291,6 @@ static void pata_bk3710_chipinit(void __iomem *base)
 static int __init pata_bk3710_probe(struct platform_device *pdev)
 {
 	struct clk *clk;
-	struct resource *mem;
 	struct ata_host *host;
 	struct ata_port *ap;
 	void __iomem *base;
@@ -310,15 +309,13 @@ static int __init pata_bk3710_probe(struct platform_device *pdev)
 	/* NOTE:  round *down* to meet minimum timings; we count in clocks */
 	ideclk_period = 1000000000UL / rate;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		pr_err(DRV_NAME ": failed to get IRQ resource\n");
 		return irq;
 	}
 
-	base = devm_ioremap_resource(&pdev->dev, mem);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
1.9.1

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

* [PATCH 7/9] drivers: ata: sata_dwc_460ex: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
                   ` (4 preceding siblings ...)
  2019-03-12  9:19 ` [PATCH 6/9] drivers: ata: pata_bk3710: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 8/9] drivers: ata: sata_gemini: " Enrico Weigelt, metux IT consult
  2019-03-12  9:19 ` [PATCH 9/9] drivers: ata: sata_rcar: " Enrico Weigelt, metux IT consult
  7 siblings, 0 replies; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/sata_dwc_460ex.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 6f142aa..c57b348 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -241,7 +241,6 @@ static int sata_dwc_dma_init_old(struct platform_device *pdev,
 				 struct sata_dwc_device *hsdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct resource *res;
 
 	hsdev->dma = devm_kzalloc(&pdev->dev, sizeof(*hsdev->dma), GFP_KERNEL);
 	if (!hsdev->dma)
@@ -258,8 +257,7 @@ static int sata_dwc_dma_init_old(struct platform_device *pdev,
 	}
 
 	/* Get physical SATA DMA register base address */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	hsdev->dma->regs = devm_ioremap_resource(&pdev->dev, res);
+	hsdev->dma->regs = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(hsdev->dma->regs))
 		return PTR_ERR(hsdev->dma->regs);
 
-- 
1.9.1

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

* [PATCH 8/9] drivers: ata: sata_gemini: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
                   ` (5 preceding siblings ...)
  2019-03-12  9:19 ` [PATCH 7/9] drivers: ata: sata_dwc_460ex: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-04-03  3:37   ` Linus Walleij
  2019-03-12  9:19 ` [PATCH 9/9] drivers: ata: sata_rcar: " Enrico Weigelt, metux IT consult
  7 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/sata_gemini.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
index 46950e0..96cca96 100644
--- a/drivers/ata/sata_gemini.c
+++ b/drivers/ata/sata_gemini.c
@@ -317,7 +317,6 @@ static int gemini_sata_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	struct sata_gemini *sg;
 	struct regmap *map;
-	struct resource *res;
 	enum gemini_muxmode muxmode;
 	u32 gmode;
 	u32 gmask;
@@ -328,11 +327,7 @@ static int gemini_sata_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	sg->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-
-	sg->base = devm_ioremap_resource(dev, res);
+	sg->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sg->base))
 		return PTR_ERR(sg->base);
 
-- 
1.9.1

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

* [PATCH 9/9] drivers: ata: sata_rcar: use devm_platform_ioremap_resource()
  2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
                   ` (6 preceding siblings ...)
  2019-03-12  9:19 ` [PATCH 8/9] drivers: ata: sata_gemini: " Enrico Weigelt, metux IT consult
@ 2019-03-12  9:19 ` Enrico Weigelt, metux IT consult
  2019-03-12 15:06   ` Sergei Shtylyov
  7 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-12  9:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/sata_rcar.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 59b2317..293cc62 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -886,7 +886,6 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct ata_host *host;
 	struct sata_rcar_priv *priv;
-	struct resource *mem;
 	int irq;
 	int ret = 0;
 
@@ -916,8 +915,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
 
 	host->private_data = priv;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->base = devm_ioremap_resource(dev, mem);
+	priv->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->base)) {
 		ret = PTR_ERR(priv->base);
 		goto err_pm_put;
-- 
1.9.1

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

* Re: [PATCH 3/9] drivers: ata: ahci_tegra: use devm_platform_ioremap_resource()
  2019-03-12  9:19 ` [PATCH 3/9] drivers: ata: ahci_tegra: " Enrico Weigelt, metux IT consult
@ 2019-03-12 10:04   ` Jon Hunter
  0 siblings, 0 replies; 15+ messages in thread
From: Jon Hunter @ 2019-03-12 10:04 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra


On 12/03/2019 09:19, Enrico Weigelt, metux IT consult wrote:
> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  drivers/ata/ahci_tegra.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
> index 004f260..88748ca 100644
> --- a/drivers/ata/ahci_tegra.c
> +++ b/drivers/ata/ahci_tegra.c
> @@ -490,7 +490,6 @@ static int tegra_ahci_probe(struct platform_device *pdev)
>  {
>  	struct ahci_host_priv *hpriv;
>  	struct tegra_ahci_priv *tegra;
> -	struct resource *res;
>  	int ret;
>  	unsigned int i;
>  
> @@ -507,19 +506,17 @@ static int tegra_ahci_probe(struct platform_device *pdev)
>  	tegra->pdev = pdev;
>  	tegra->soc = of_device_get_match_data(&pdev->dev);
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res);
> +	tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1);
>  	if (IS_ERR(tegra->sata_regs))
>  		return PTR_ERR(tegra->sata_regs);
>  
>  	/*
>  	 * AUX registers is optional.
>  	 */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -	if (res) {
> -		tegra->sata_aux_regs = devm_ioremap_resource(&pdev->dev, res);
> -		if (IS_ERR(tegra->sata_aux_regs))
> -			return PTR_ERR(tegra->sata_aux_regs);
> +	tegra->sata_aux_regs = devm_platform_ioremap_resource(pdev, 2);
> +	if (IS_ERR(tegra->sata_aux_regs)) {
> +		dev_info(&pdev->dev, "Cant get aux registers (optional)");

dev_err?

> +		tegra->sata_aux_regs = NULL;

This bit does not look right, because although the AUX registers are
optional, now we don't know if it failed because they are not supported
for a given device or something else failed. So I am not sure we can do
this here.

Cheers
Jon

-- 
nvpublic

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

* Re: [PATCH 4/9] drivers: ata: ahci_xgene: use devm_platform_ioremap_resource()
  2019-03-12  9:19 ` [PATCH 4/9] drivers: ata: ahci_xgene: " Enrico Weigelt, metux IT consult
@ 2019-03-12 14:43   ` Sergei Shtylyov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2019-03-12 14:43 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

Hello!

On 03/12/2019 12:19 PM, Enrico Weigelt, metux IT consult wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  drivers/ata/ahci_xgene.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
> index 7e157e1..99c622c 100644
> --- a/drivers/ata/ahci_xgene.c
> +++ b/drivers/ata/ahci_xgene.c
> @@ -752,7 +752,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
[...]
>  	/* Retrieve the optional IP mux resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
> -	if (res) {
> -		void __iomem *csr = devm_ioremap_resource(dev, res);
> -		if (IS_ERR(csr))
> -			return PTR_ERR(csr);
> -
> -		ctx->csr_mux = csr;
> +	ctx->csr_mux = csr = devm_platform_ioremap_resource(pdev, 4);
> +	if (IS_ERR(ctx->csr_mux)) {
> +		dev_info(&pdev->dev, "cant get ip mux resource (optional)");

   Can't.

> +		ctx->csr_mux = NULL;

MBR, Sergei

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

* Re: [PATCH 9/9] drivers: ata: sata_rcar: use devm_platform_ioremap_resource()
  2019-03-12  9:19 ` [PATCH 9/9] drivers: ata: sata_rcar: " Enrico Weigelt, metux IT consult
@ 2019-03-12 15:06   ` Sergei Shtylyov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2019-03-12 15:06 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

On 03/12/2019 12:19 PM, Enrico Weigelt, metux IT consult wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

[...]

MBR, Sergei

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

* Re: [PATCH 8/9] drivers: ata: sata_gemini: use devm_platform_ioremap_resource()
  2019-03-12  9:19 ` [PATCH 8/9] drivers: ata: sata_gemini: " Enrico Weigelt, metux IT consult
@ 2019-04-03  3:37   ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2019-04-03  3:37 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, Jens Axboe, Hans de Goede,
	Bartlomiej Zolnierkiewicz, linux-ide, linux-tegra

On Tue, Mar 12, 2019 at 4:19 PM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 4/9] drivers: ata: ahci_xgene: use devm_platform_ioremap_resource()
  2019-08-20 12:35 ` [PATCH 4/9] drivers: ata: ahci_xgene: " Enrico Weigelt, metux IT consult
@ 2019-08-20 13:45   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 15+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-08-20 13:45 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, axboe, hdegoede, linus.walleij, linux-ide, linux-tegra


On 8/20/19 2:35 PM, Enrico Weigelt, metux IT consult wrote:
> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  drivers/ata/ahci_xgene.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
> index 16246c8..5391f5d 100644
> --- a/drivers/ata/ahci_xgene.c
> +++ b/drivers/ata/ahci_xgene.c
> @@ -739,7 +739,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct ahci_host_priv *hpriv;
>  	struct xgene_ahci_context *ctx;
> -	struct resource *res;
>  	const struct of_device_id *of_devid;
>  	enum xgene_ahci_version version = XGENE_AHCI_V1;
>  	const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info,
> @@ -759,31 +758,25 @@ static int xgene_ahci_probe(struct platform_device *pdev)
>  	ctx->dev = dev;
>  
>  	/* Retrieve the IP core resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	ctx->csr_core = devm_ioremap_resource(dev, res);
> +	ctx->csr_core = devm_platform_ioremap_resource(pdev, 1);
>  	if (IS_ERR(ctx->csr_core))
>  		return PTR_ERR(ctx->csr_core);
>  
>  	/* Retrieve the IP diagnostic resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -	ctx->csr_diag = devm_ioremap_resource(dev, res);
> +	ctx->csr_diag = devm_platform_ioremap_resource(pdev, 2);
>  	if (IS_ERR(ctx->csr_diag))
>  		return PTR_ERR(ctx->csr_diag);
>  
>  	/* Retrieve the IP AXI resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> -	ctx->csr_axi = devm_ioremap_resource(dev, res);
> +	ctx->csr_axi = devm_platform_ioremap_resource(pdev, 3);
>  	if (IS_ERR(ctx->csr_axi))
>  		return PTR_ERR(ctx->csr_axi);
>  
>  	/* Retrieve the optional IP mux resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
> -	if (res) {
> -		void __iomem *csr = devm_ioremap_resource(dev, res);
> -		if (IS_ERR(csr))
> -			return PTR_ERR(csr);
> -
> -		ctx->csr_mux = csr;
> +	ctx->csr_mux = csr = devm_platform_ioremap_resource(pdev, 4);

This conversion is incorrect - despite the resource being optional
we will get error message from devm_[platform_]ioremap_resource()
(it always prints an error on !res condition).

> +	if (IS_ERR(ctx->csr_mux)) {
> +		dev_info(&pdev->dev, "cant get ip mux resource (optional)");

No need for this message.

> +		ctx->csr_mux = NULL;
>  	}
>  
>  	of_devid = of_match_device(xgene_ahci_of_match, dev);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* [PATCH 4/9] drivers: ata: ahci_xgene: use devm_platform_ioremap_resource()
  2019-08-20 12:35 [PATCH 1/9] drivers: ata: ahci_octeon: " Enrico Weigelt, metux IT consult
@ 2019-08-20 12:35 ` Enrico Weigelt, metux IT consult
  2019-08-20 13:45   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-08-20 12:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: axboe, hdegoede, b.zolnierkie, linus.walleij, linux-ide, linux-tegra

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/ata/ahci_xgene.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 16246c8..5391f5d 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -739,7 +739,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct ahci_host_priv *hpriv;
 	struct xgene_ahci_context *ctx;
-	struct resource *res;
 	const struct of_device_id *of_devid;
 	enum xgene_ahci_version version = XGENE_AHCI_V1;
 	const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info,
@@ -759,31 +758,25 @@ static int xgene_ahci_probe(struct platform_device *pdev)
 	ctx->dev = dev;
 
 	/* Retrieve the IP core resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	ctx->csr_core = devm_ioremap_resource(dev, res);
+	ctx->csr_core = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(ctx->csr_core))
 		return PTR_ERR(ctx->csr_core);
 
 	/* Retrieve the IP diagnostic resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	ctx->csr_diag = devm_ioremap_resource(dev, res);
+	ctx->csr_diag = devm_platform_ioremap_resource(pdev, 2);
 	if (IS_ERR(ctx->csr_diag))
 		return PTR_ERR(ctx->csr_diag);
 
 	/* Retrieve the IP AXI resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
-	ctx->csr_axi = devm_ioremap_resource(dev, res);
+	ctx->csr_axi = devm_platform_ioremap_resource(pdev, 3);
 	if (IS_ERR(ctx->csr_axi))
 		return PTR_ERR(ctx->csr_axi);
 
 	/* Retrieve the optional IP mux resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
-	if (res) {
-		void __iomem *csr = devm_ioremap_resource(dev, res);
-		if (IS_ERR(csr))
-			return PTR_ERR(csr);
-
-		ctx->csr_mux = csr;
+	ctx->csr_mux = csr = devm_platform_ioremap_resource(pdev, 4);
+	if (IS_ERR(ctx->csr_mux)) {
+		dev_info(&pdev->dev, "cant get ip mux resource (optional)");
+		ctx->csr_mux = NULL;
 	}
 
 	of_devid = of_match_device(xgene_ahci_of_match, dev);
-- 
1.9.1


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

end of thread, other threads:[~2019-08-20 13:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  9:19 [PATCH 1/9] drivers: ata: ahci_octeon: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult
2019-03-12  9:19 ` [PATCH 2/9] drivers: ata: ahci_seattle: " Enrico Weigelt, metux IT consult
2019-03-12  9:19 ` [PATCH 3/9] drivers: ata: ahci_tegra: " Enrico Weigelt, metux IT consult
2019-03-12 10:04   ` Jon Hunter
2019-03-12  9:19 ` [PATCH 4/9] drivers: ata: ahci_xgene: " Enrico Weigelt, metux IT consult
2019-03-12 14:43   ` Sergei Shtylyov
2019-03-12  9:19 ` [PATCH 5/9] drivers: ata: libahci_platform: " Enrico Weigelt, metux IT consult
2019-03-12  9:19 ` [PATCH 6/9] drivers: ata: pata_bk3710: " Enrico Weigelt, metux IT consult
2019-03-12  9:19 ` [PATCH 7/9] drivers: ata: sata_dwc_460ex: " Enrico Weigelt, metux IT consult
2019-03-12  9:19 ` [PATCH 8/9] drivers: ata: sata_gemini: " Enrico Weigelt, metux IT consult
2019-04-03  3:37   ` Linus Walleij
2019-03-12  9:19 ` [PATCH 9/9] drivers: ata: sata_rcar: " Enrico Weigelt, metux IT consult
2019-03-12 15:06   ` Sergei Shtylyov
2019-08-20 12:35 [PATCH 1/9] drivers: ata: ahci_octeon: " Enrico Weigelt, metux IT consult
2019-08-20 12:35 ` [PATCH 4/9] drivers: ata: ahci_xgene: " Enrico Weigelt, metux IT consult
2019-08-20 13:45   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).