public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] ata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs
@ 2021-12-09 14:35 Andy Shevchenko
  2021-12-09 14:35 ` [PATCH v1 2/3] ata: sata_dwc_460ex: Use temporary variable for struct device Andy Shevchenko
  2021-12-09 14:35 ` [PATCH v1 3/3] ata: sata_dwc_460ex: Remove unused forward declaration Andy Shevchenko
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2021-12-09 14:35 UTC (permalink / raw)
  To: Andy Shevchenko, linux-ide, linux-kernel; +Cc: Damien Le Moal

Use devm_platform_get_and_ioremap_resource() and
devm_platform_ioremap_resource() APIs instead of their
open coded analogues.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/ata/sata_dwc_460ex.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 338c2e50f759..513bee589d12 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -237,7 +237,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)
@@ -254,8 +253,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);
 
@@ -1228,8 +1226,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
 	host->private_data = hsdev;
 
 	/* Ioremap SATA registers */
-	res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&ofdev->dev, res);
+	base = devm_platform_get_and_ioremap_resource(ofdev, 0, &res);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 	dev_dbg(&ofdev->dev, "ioremap done for SATA register address\n");
-- 
2.33.0


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

end of thread, other threads:[~2021-12-17  1:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-09 14:35 [PATCH v1 1/3] ata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs Andy Shevchenko
2021-12-09 14:35 ` [PATCH v1 2/3] ata: sata_dwc_460ex: Use temporary variable for struct device Andy Shevchenko
2021-12-09 22:40   ` Damien Le Moal
2021-12-10  8:42     ` Andy Shevchenko
2021-12-10  9:25       ` Hannes Reinecke
2021-12-17  1:00   ` Damien Le Moal
2021-12-09 14:35 ` [PATCH v1 3/3] ata: sata_dwc_460ex: Remove unused forward declaration Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox