diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-09-04 16:59:04 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-04 19:20:52 +0300 |
commit | e751032bcbd73667dde1a640109653a64f45a7d1 (patch) | |
tree | 02ee7ceba52aa1625681d1799d818b7c0aa28a3d /drivers/spi/spi-pic32-sqi.c | |
parent | f601a654bb47b89a469446ecca6c0183a5c75b96 (diff) | |
download | linux-e751032bcbd73667dde1a640109653a64f45a7d1.tar.xz |
spi: pic32-sqi: 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-23-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pic32-sqi.c')
-rw-r--r-- | drivers/spi/spi-pic32-sqi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index 11b692923fd7..86ad17597f5f 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -570,7 +570,6 @@ static int pic32_sqi_probe(struct platform_device *pdev) { struct spi_master *master; struct pic32_sqi *sqi; - struct resource *reg; int ret; master = spi_alloc_master(&pdev->dev, sizeof(*sqi)); @@ -580,8 +579,7 @@ static int pic32_sqi_probe(struct platform_device *pdev) sqi = spi_master_get_devdata(master); sqi->master = master; - reg = platform_get_resource(pdev, IORESOURCE_MEM, 0); - sqi->regs = devm_ioremap_resource(&pdev->dev, reg); + sqi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(sqi->regs)) { ret = PTR_ERR(sqi->regs); goto err_free_master; |