aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-18 16:45:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-18 16:45:27 -0700
commit7f02e1ce4a13edf295fcedbc663a8ca69bc1ff6e (patch)
treedb8b1bb648918b0364d6d4f93b7b61877e2ac20d /drivers/spi
parentMerge tag 'rpmsg-v4.19' of git://github.com/andersson/remoteproc (diff)
parenthwspinlock: Fix incorrect return pointers (diff)
downloadlinux-dev-7f02e1ce4a13edf295fcedbc663a8ca69bc1ff6e.tar.xz
linux-dev-7f02e1ce4a13edf295fcedbc663a8ca69bc1ff6e.zip
Merge tag 'hwlock-v4.19' of git://github.com/andersson/remoteproc
Pull hwspinlock updates from Bjorn Andersson: "This introduces devres helpers and an API to request a lock by name, then migrates the sprd SPI driver to use these" * tag 'hwlock-v4.19' of git://github.com/andersson/remoteproc: hwspinlock: Fix incorrect return pointers spi: sprd: Change to use devm_hwspin_lock_request_specific() spi: sprd: Replace of_hwspin_lock_get_id() with of_hwspin_lock_get_id_byname() hwspinlock: Fix one comment mistake hwspinlock: Remove redundant config hwspinlock: Add devm_xxx() APIs to register/unregister one hwlock controller hwspinlock: Add devm_xxx() APIs to request/free hwlock hwspinlock: Add one new API to support getting a specific hwlock by the name
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-sprd-adi.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index 197d4b0d81af..df5960bddfe6 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -459,13 +459,13 @@ static int sprd_adi_probe(struct platform_device *pdev)
sadi->slave_pbase = res->start + ADI_SLAVE_OFFSET;
sadi->ctlr = ctlr;
sadi->dev = &pdev->dev;
- ret = of_hwspin_lock_get_id(np, 0);
+ ret = of_hwspin_lock_get_id_byname(np, "adi");
if (ret < 0) {
dev_err(&pdev->dev, "can not get the hardware spinlock\n");
goto put_ctlr;
}
- sadi->hwlock = hwspin_lock_request_specific(ret);
+ sadi->hwlock = devm_hwspin_lock_request_specific(&pdev->dev, ret);
if (!sadi->hwlock) {
ret = -ENXIO;
goto put_ctlr;
@@ -483,7 +483,7 @@ static int sprd_adi_probe(struct platform_device *pdev)
ret = devm_spi_register_controller(&pdev->dev, ctlr);
if (ret) {
dev_err(&pdev->dev, "failed to register SPI controller\n");
- goto free_hwlock;
+ goto put_ctlr;
}
sadi->restart_handler.notifier_call = sprd_adi_restart_handler;
@@ -491,13 +491,11 @@ static int sprd_adi_probe(struct platform_device *pdev)
ret = register_restart_handler(&sadi->restart_handler);
if (ret) {
dev_err(&pdev->dev, "can not register restart handler\n");
- goto free_hwlock;
+ goto put_ctlr;
}
return 0;
-free_hwlock:
- hwspin_lock_free(sadi->hwlock);
put_ctlr:
spi_controller_put(ctlr);
return ret;
@@ -509,7 +507,6 @@ static int sprd_adi_remove(struct platform_device *pdev)
struct sprd_adi *sadi = spi_controller_get_devdata(ctlr);
unregister_restart_handler(&sadi->restart_handler);
- hwspin_lock_free(sadi->hwlock);
return 0;
}