From d4942c119c978f1c6649212d2e42696bef43dd27 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Fri, 22 Jun 2018 16:09:04 +0800 Subject: spi: sprd: Replace of_hwspin_lock_get_id() with of_hwspin_lock_get_id_byname() Now the hwlock core has supplied new function to get a specific hwlock id by one hwlock name, which is more clear for users. So change to use of_hwspin_lock_get_id_byname(). Acked-by: Mark Brown Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson --- drivers/spi/spi-sprd-adi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/spi') diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 197d4b0d81af..2d4c0419e208 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -459,7 +459,7 @@ 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; -- cgit v1.2.3 From c8d049896729423a979d2838175d251b9cfee3b5 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Fri, 22 Jun 2018 16:09:05 +0800 Subject: spi: sprd: Change to use devm_hwspin_lock_request_specific() Change to use devm_hwspin_lock_request_specific() instead of freeing the hwlock explicitly when unbound the device. Acked-by: Mark Brown Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson --- drivers/spi/spi-sprd-adi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/spi') diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 2d4c0419e208..df5960bddfe6 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -465,7 +465,7 @@ static int sprd_adi_probe(struct platform_device *pdev) 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; } -- cgit v1.2.3