spi: cadence: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190904135918.25352-9-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
e364c8c204
Коммит
4585bb92a5
|
@ -474,7 +474,6 @@ static int cdns_spi_probe(struct platform_device *pdev)
|
|||
int ret = 0, irq;
|
||||
struct spi_master *master;
|
||||
struct cdns_spi *xspi;
|
||||
struct resource *res;
|
||||
u32 num_cs;
|
||||
|
||||
master = spi_alloc_master(&pdev->dev, sizeof(*xspi));
|
||||
|
@ -485,8 +484,7 @@ static int cdns_spi_probe(struct platform_device *pdev)
|
|||
master->dev.of_node = pdev->dev.of_node;
|
||||
platform_set_drvdata(pdev, master);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
xspi->regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
xspi->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(xspi->regs)) {
|
||||
ret = PTR_ERR(xspi->regs);
|
||||
goto remove_master;
|
||||
|
|
Загрузка…
Ссылка в новой задаче