spi: ti-qspi: improve ->remove() callback
authorFelipe Balbi <balbi@ti.com>
Thu, 29 Oct 2015 13:57:30 +0000 (08:57 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 30 Oct 2015 01:24:57 +0000 (10:24 +0900)
there's no need to call pm_runtime_get_sync()
followed by pm_runtime_put(). We should, instead,
just call pm_runtime_put_sync() and pm_runtime_disable().

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ti-qspi.c

index 89cf0c8..432bcc3 100644 (file)
@@ -555,16 +555,7 @@ free_master:
 
 static int ti_qspi_remove(struct platform_device *pdev)
 {
-       struct ti_qspi *qspi = platform_get_drvdata(pdev);
-       int ret;
-
-       ret = pm_runtime_get_sync(qspi->dev);
-       if (ret < 0) {
-               dev_err(qspi->dev, "pm_runtime_get_sync() failed\n");
-               return ret;
-       }
-
-       pm_runtime_put(qspi->dev);
+       pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
        return 0;