summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-sh.c
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2021-07-07 01:19:43 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2021-07-07 01:19:43 +0200
commitd900385139e5aa8d584dee92c87bb85d0226253e (patch)
tree26aa082f242221c535f2d8aa03b0c314c713e8ea /drivers/spi/spi-sh.c
parent56168452b2a2fa8b4efc664d9fcb08536486a1ba (diff)
parent200ecf5055dfba12b9bff6984830a7cdddee8ab1 (diff)
Merge tag 'v4.4.274' into toradex_vf_4.4-next
Linux 4.4.274
Diffstat (limited to 'drivers/spi/spi-sh.c')
-rw-r--r--drivers/spi/spi-sh.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c
index 502501187c9e..f062ebb46e0e 100644
--- a/drivers/spi/spi-sh.c
+++ b/drivers/spi/spi-sh.c
@@ -451,7 +451,7 @@ static int spi_sh_probe(struct platform_device *pdev)
return -ENODEV;
}
- master = spi_alloc_master(&pdev->dev, sizeof(struct spi_sh_data));
+ master = devm_spi_alloc_master(&pdev->dev, sizeof(struct spi_sh_data));
if (master == NULL) {
dev_err(&pdev->dev, "spi_alloc_master error.\n");
return -ENOMEM;
@@ -469,16 +469,14 @@ static int spi_sh_probe(struct platform_device *pdev)
break;
default:
dev_err(&pdev->dev, "No support width\n");
- ret = -ENODEV;
- goto error1;
+ return -ENODEV;
}
ss->irq = irq;
ss->master = master;
ss->addr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (ss->addr == NULL) {
dev_err(&pdev->dev, "ioremap error.\n");
- ret = -ENOMEM;
- goto error1;
+ return -ENOMEM;
}
INIT_LIST_HEAD(&ss->queue);
spin_lock_init(&ss->lock);
@@ -488,8 +486,7 @@ static int spi_sh_probe(struct platform_device *pdev)
dev_name(master->dev.parent));
if (ss->workqueue == NULL) {
dev_err(&pdev->dev, "create workqueue error\n");
- ret = -EBUSY;
- goto error1;
+ return -EBUSY;
}
ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss);
@@ -516,9 +513,6 @@ static int spi_sh_probe(struct platform_device *pdev)
free_irq(irq, ss);
error2:
destroy_workqueue(ss->workqueue);
- error1:
- spi_master_put(master);
-
return ret;
}