From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sourav Poddar Subject: Re: [PATCH] spi/qspi: cleanup qspi remova path and error check. Date: Tue, 19 Nov 2013 16:30:08 +0530 Message-ID: <528B44B8.9050700@ti.com> References: <1384858703-30938-1-git-send-email-sourav.poddar@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Sourav Poddar Return-path: In-Reply-To: <1384858703-30938-1-git-send-email-sourav.poddar-l0cyMroinI0@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: On Tuesday 19 November 2013 04:28 PM, Sourav Poddar wrote: > There is a bug in qspi removal path, as a result of which > qspi cannot be removed when used as a module. The patch > solves the bug and qspi can be removed cleanly. > Also align the runtime error path check through out the code. > > Tested on DRA7 board. > > Signed-off-by: Sourav Poddar This is on Mark Brown SPI tree, branch: topic/qspi > --- > drivers/spi/spi-ti-qspi.c | 20 ++++++++++++++++++-- > 1 files changed, 18 insertions(+), 2 deletions(-) > > diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c > index 0b71270..033ef8d 100644 > --- a/drivers/spi/spi-ti-qspi.c > +++ b/drivers/spi/spi-ti-qspi.c > @@ -161,7 +161,7 @@ static int ti_qspi_setup(struct spi_device *spi) > qspi->spi_max_frequency, clk_div); > > ret = pm_runtime_get_sync(qspi->dev); > - if (ret) { > + if (ret< 0) { > dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); > return ret; > } > @@ -517,10 +517,26 @@ free_master: > > static int ti_qspi_remove(struct platform_device *pdev) > { > - struct ti_qspi *qspi = platform_get_drvdata(pdev); > + struct spi_master *master; > + struct ti_qspi *qspi; > + int ret; > + > + master = platform_get_drvdata(pdev); > + qspi = spi_master_get_devdata(master); > + > + ret = pm_runtime_get_sync(qspi->dev); > + if (ret< 0) { > + dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); > + return ret; > + } > > ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG); > > + pm_runtime_put(qspi->dev); > + pm_runtime_disable(&pdev->dev); > + > + spi_unregister_master(master); > + > return 0; > } > -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html