mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
spi: amd: Use devm_platform_ioremap_resource() in amd_spi_probe
Simplify this function implementation by using a known wrapper function. Signed-off-by: Qing Zhang <zhangqing@loongson.cn> Link: https://lore.kernel.org/r/1605930231-19448-1-git-send-email-zhangqing@loongson.cn Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -250,7 +250,6 @@ static int amd_spi_probe(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct spi_master *master;
|
struct spi_master *master;
|
||||||
struct amd_spi *amd_spi;
|
struct amd_spi *amd_spi;
|
||||||
struct resource *res;
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
/* Allocate storage for spi_master and driver private data */
|
/* Allocate storage for spi_master and driver private data */
|
||||||
@@ -261,9 +260,7 @@ static int amd_spi_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
amd_spi = spi_master_get_devdata(master);
|
amd_spi = spi_master_get_devdata(master);
|
||||||
|
amd_spi->io_remap_addr = devm_platform_ioremap_resource(pdev, 0);
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
||||||
amd_spi->io_remap_addr = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(amd_spi->io_remap_addr)) {
|
if (IS_ERR(amd_spi->io_remap_addr)) {
|
||||||
err = PTR_ERR(amd_spi->io_remap_addr);
|
err = PTR_ERR(amd_spi->io_remap_addr);
|
||||||
dev_err(dev, "error %d ioremap of SPI registers failed\n", err);
|
dev_err(dev, "error %d ioremap of SPI registers failed\n", err);
|
||||||
|
Reference in New Issue
Block a user