aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-09-04 09:59:02 -0400
committerMark Brown <broonie@kernel.org>2019-09-04 12:20:23 -0400
commit4c6f537a0397d24cd74eefd473a74488801be673 (patch)
tree5d2da8b150db7135c82055c22da72265131f8734 /drivers/spi
parentdcbceb6de0db24d383797d574e4a800fbef3580b (diff)
spi: nuc900: 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-21-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-nuc900.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c
index f65a029e3fe9..61400358f4be 100644
--- a/drivers/spi/spi-nuc900.c
+++ b/drivers/spi/spi-nuc900.c
@@ -327,7 +327,6 @@ static int nuc900_spi_probe(struct platform_device *pdev)
327{ 327{
328 struct nuc900_spi *hw; 328 struct nuc900_spi *hw;
329 struct spi_master *master; 329 struct spi_master *master;
330 struct resource *res;
331 int err = 0; 330 int err = 0;
332 331
333 master = spi_alloc_master(&pdev->dev, sizeof(struct nuc900_spi)); 332 master = spi_alloc_master(&pdev->dev, sizeof(struct nuc900_spi));
@@ -358,8 +357,7 @@ static int nuc900_spi_probe(struct platform_device *pdev)
358 hw->bitbang.chipselect = nuc900_spi_chipsel; 357 hw->bitbang.chipselect = nuc900_spi_chipsel;
359 hw->bitbang.txrx_bufs = nuc900_spi_txrx; 358 hw->bitbang.txrx_bufs = nuc900_spi_txrx;
360 359
361 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 360 hw->regs = devm_platform_ioremap_resource(pdev, 0);
362 hw->regs = devm_ioremap_resource(&pdev->dev, res);
363 if (IS_ERR(hw->regs)) { 361 if (IS_ERR(hw->regs)) {
364 err = PTR_ERR(hw->regs); 362 err = PTR_ERR(hw->regs);
365 goto err_pdata; 363 goto err_pdata;