mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Balaji T K <balajitk@ti.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-mmc@vger.kernel.org>,
	Chris Ball <cjb@laptop.org>, <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs
Date: Thu, 10 Oct 2013 19:36:31 +0530	[thread overview]
Message-ID: <5256B467.8080402@ti.com> (raw)
In-Reply-To: <1380207292-16968-15-git-send-email-ulf.hansson@linaro.org>

On Thursday 26 September 2013 08:24 PM, Ulf Hansson wrote:
> Suspend and resume of cards are being handled from the protocol layer
> and consequently the mmc_suspend|resume_host APIs are deprecated.
>
> This means we can simplify the suspend|resume callbacks by removing the
> use of the deprecated APIs. Additional cleanup done for keeping track
> suspended state.
>
> Cc: Balaji T K <balajitk@ti.com>
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Balaji T K <balajitk@ti.com>

> ---
>   drivers/mmc/host/omap_hsmmc.c |   37 +++----------------------------------
>   1 file changed, 3 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 6ac63df..eb6fb28 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -170,7 +170,6 @@ struct omap_hsmmc_host {
>   	unsigned int		dma_sg_idx;
>   	unsigned char		bus_mode;
>   	unsigned char		power_mode;
> -	int			suspended;
>   	int			irq;
>   	int			use_dma, dma_ch;
>   	struct dma_chan		*tx_chan;
> @@ -1178,9 +1177,6 @@ static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
>   	struct omap_mmc_slot_data *slot = &mmc_slot(host);
>   	int carddetect;
>
> -	if (host->suspended)
> -		return IRQ_HANDLED;
> -
>   	sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
>
>   	if (slot->card_detect)
> @@ -1643,11 +1639,6 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data)
>   	seq_printf(s, "mmc%d:\n ctx_loss:\t%d:%d\n\nregs:\n",
>   			mmc->index, host->context_loss, context_loss);
>
> -	if (host->suspended) {
> -		seq_printf(s, "host suspended, can't read registers\n");
> -		return 0;
> -	}
> -
>   	pm_runtime_get_sync(host->dev);
>
>   	seq_printf(s, "CON:\t\t0x%08x\n",
> @@ -2119,23 +2110,12 @@ static void omap_hsmmc_complete(struct device *dev)
>
>   static int omap_hsmmc_suspend(struct device *dev)
>   {
> -	int ret = 0;
>   	struct omap_hsmmc_host *host = dev_get_drvdata(dev);
>
>   	if (!host)
>   		return 0;
>
> -	if (host && host->suspended)
> -		return 0;
> -
>   	pm_runtime_get_sync(host->dev);
> -	host->suspended = 1;
> -	ret = mmc_suspend_host(host->mmc);
> -
> -	if (ret) {
> -		host->suspended = 0;
> -		goto err;
> -	}
>
>   	if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) {
>   		omap_hsmmc_disable_irq(host);
> @@ -2145,23 +2125,19 @@ static int omap_hsmmc_suspend(struct device *dev)
>
>   	if (host->dbclk)
>   		clk_disable_unprepare(host->dbclk);
> -err:
> +
>   	pm_runtime_put_sync(host->dev);
> -	return ret;
> +	return 0;
>   }
>
>   /* Routine to resume the MMC device */
>   static int omap_hsmmc_resume(struct device *dev)
>   {
> -	int ret = 0;
>   	struct omap_hsmmc_host *host = dev_get_drvdata(dev);
>
>   	if (!host)
>   		return 0;
>
> -	if (host && !host->suspended)
> -		return 0;
> -
>   	pm_runtime_get_sync(host->dev);
>
>   	if (host->dbclk)
> @@ -2172,16 +2148,9 @@ static int omap_hsmmc_resume(struct device *dev)
>
>   	omap_hsmmc_protect_card(host);
>
> -	/* Notify the core to resume the host */
> -	ret = mmc_resume_host(host->mmc);
> -	if (ret == 0)
> -		host->suspended = 0;
> -
>   	pm_runtime_mark_last_busy(host->dev);
>   	pm_runtime_put_autosuspend(host->dev);
> -
> -	return ret;
> -
> +	return 0;
>   }
>
>   #else
>


  reply	other threads:[~2013-10-10 14:06 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 14:54 [PATCH 00/27] mmc: Remove the deprecated APIs mmc_suspend|resume_host Ulf Hansson
2013-09-26 14:54 ` [PATCH 01/27] mmc: atmel-mci: Remove redundant suspend and resume callbacks Ulf Hansson
2013-09-26 14:54 ` [PATCH 02/27] mmc: au1xmmc: Move away from using deprecated APIs Ulf Hansson
2013-09-26 14:54 ` [PATCH 03/27] mmc: bfin_sdh: " Ulf Hansson
2013-10-08  3:05   ` Sonic Zhang
2013-09-26 14:54 ` [PATCH 04/27] mmc: cb710: " Ulf Hansson
2013-09-27 16:08   ` Michał Mirosław
2013-09-26 14:54 ` [PATCH 05/27] mmc: davinci_mmc: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 06/27] mmc: dw_mmc: " Ulf Hansson
2013-10-23 11:17   ` Seungwon Jeon
2013-09-26 14:54 ` [PATCH 07/27] mmc: jz4740: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 08/27] mmc: msm_sdcc: " Ulf Hansson
2013-09-26 20:58   ` David Brown
2013-09-26 14:54 ` [PATCH 09/27] mmc: mvsdio: Remove redundant suspend and resume callbacks Ulf Hansson
2013-09-26 15:40   ` Nicolas Pitre
2013-09-27  8:55     ` Ulf Hansson
2013-09-26 14:54 ` [PATCH 10/27] mmc: vub300: " Ulf Hansson
2013-09-27 16:22   ` Alan Stern
2013-09-30  8:24     ` Ulf Hansson
2013-09-26 14:54 ` [PATCH 11/27] mmc: sdhci: Move away from using deprecated APIs Ulf Hansson
2013-09-26 14:54 ` [PATCH 12/27] mmc: tifm_sd: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 13/27] mmc: omap: Remove redundant suspend and resume callbacks Ulf Hansson
2013-09-26 14:54 ` [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs Ulf Hansson
2013-10-10 14:06   ` Balaji T K [this message]
2013-09-26 14:54 ` [PATCH 15/27] mmc: mxs-mmc: " Ulf Hansson
2013-09-27  1:30   ` Shawn Guo
2013-09-26 14:54 ` [PATCH 16/27] mmc: mxcmmc: " Ulf Hansson
2013-09-27  7:19   ` Sascha Hauer
2013-09-26 14:54 ` [PATCH 17/27] mmc: wmt-sdmmc: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 18/27] mmc: s3cmci: Remove redundant suspend and resume callbacks Ulf Hansson
2013-09-26 14:54 ` [PATCH 19/27] mmc: pxamci: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 20/27] mmc: wbsd: Move away from using deprecated APIs Ulf Hansson
2013-09-26 14:54 ` [PATCH 21/27] mmc: rtsx: Remove redundant suspend and resume callbacks Ulf Hansson
2013-09-26 14:54 ` [PATCH 22/27] mmc: sdricoh_cs: Move away from using deprecated APIs Ulf Hansson
2013-09-29 17:56   ` Sascha Sommer
2013-09-26 14:54 ` [PATCH 23/27] mmc: sh_mmcif: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 24/27] mmc: tmio: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 25/27] mmc: via-sdmmc: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 26/27] mmc: mmci: " Ulf Hansson
2013-09-26 14:54 ` [PATCH 27/27] mmc: core: Remove deprecated mmc_suspend|resume_host APIs Ulf Hansson

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=5256B467.8080402@ti.com \
    --to=balajitk@ti.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome