From: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
To: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
Cc: <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] spi/qspi: cleanup qspi remova path and error check.
Date: Tue, 19 Nov 2013 16:30:08 +0530 [thread overview]
Message-ID: <528B44B8.9050700@ti.com> (raw)
In-Reply-To: <1384858703-30938-1-git-send-email-sourav.poddar-l0cyMroinI0@public.gmane.org>
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<sourav.poddar-l0cyMroinI0@public.gmane.org>
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
next prev parent reply other threads:[~2013-11-19 11:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 10:58 [PATCH] spi/qspi: cleanup qspi remova path and error check Sourav Poddar
[not found] ` <1384858703-30938-1-git-send-email-sourav.poddar-l0cyMroinI0@public.gmane.org>
2013-11-19 11:00 ` Sourav Poddar [this message]
2013-11-19 11:31 ` Mark Brown
[not found] ` <20131119113125.GZ2674-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-11-19 11:50 ` Sourav Poddar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=528B44B8.9050700@ti.com \
--to=sourav.poddar-l0cymroini0@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.