Commit f713961d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Damien Le Moal
Browse files

ata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs



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

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent ab0efc06
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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");