From patchwork Thu Sep 26 14:54:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 20615 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 801EF24687 for ; Thu, 26 Sep 2013 14:56:17 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id r5sf1072934qcx.0 for ; Thu, 26 Sep 2013 07:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=sx/Af5n8WCaGS3OsorwpRutt5P+u+Kacaj5NhG0QhwI=; b=mWTwtEVRXixZRThZIthfyI9hzPxq46Vmr+gtRi8jqa4A3WCD+yJvHjqSfedEK7Znnp LXDFIemLP+lEIKorlMkUQTh/BUlSBKBCSYq0XT508tT6aTTIDVoTf+MTYk1IVXev/FC4 jx53ZbMRcd1eGHSmp3613sgPR1T8I2ZGKhQCMQ4nZhNWRyO6gLyRJMNLxx/b2aEH64Qa ndGxjj7bu3wPnaPEu0KyRYz2mK0tAZU0AD9tDVXW1uS/YAfJNhbEJBydkLeib0uSL1fg IYGGOGOViI+4R3Wye3Py2o/fL4+UHoM9sZQxoPVvv03137eIkS2ylw4Xig3ZXtaHVXha jSkg== X-Gm-Message-State: ALoCoQn/NMkFMrfiz8EavG2OIHc+BnsOfUBBUcX1wZEkjr7QLrjXdysOptR/lPKAAmW8//d1eKU+ X-Received: by 10.236.220.39 with SMTP id n37mr246715yhp.15.1380207377380; Thu, 26 Sep 2013 07:56:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.8 with SMTP id cy8ls905131qeb.18.gmail; Thu, 26 Sep 2013 07:56:17 -0700 (PDT) X-Received: by 10.58.97.228 with SMTP id ed4mr462807veb.38.1380207377228; Thu, 26 Sep 2013 07:56:17 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id wp10si491920vdb.110.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 07:56:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lc6so621431vcb.1 for ; Thu, 26 Sep 2013 07:55:47 -0700 (PDT) X-Received: by 10.58.108.74 with SMTP id hi10mr1063592veb.14.1380207347001; Thu, 26 Sep 2013 07:55:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp371113vcz; Thu, 26 Sep 2013 07:55:46 -0700 (PDT) X-Received: by 10.14.115.133 with SMTP id e5mr1887593eeh.27.1380207346046; Thu, 26 Sep 2013 07:55:46 -0700 (PDT) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by mx.google.com with ESMTPS id 7si1859373eeu.158.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 07:55:46 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.52 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.83.52; Received: by mail-ee0-f52.google.com with SMTP id c41so612570eek.11 for ; Thu, 26 Sep 2013 07:55:45 -0700 (PDT) X-Received: by 10.14.211.4 with SMTP id v4mr1844946eeo.81.1380207345526; Thu, 26 Sep 2013 07:55:45 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id x47sm4813555eea.16.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 07:55:44 -0700 (PDT) From: Ulf Hansson To: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Chris Ball Cc: Ulf Hansson , Balaji T K , linux-omap@vger.kernel.org Subject: [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs Date: Thu, 26 Sep 2013 16:54:39 +0200 Message-Id: <1380207292-16968-15-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380207292-16968-1-git-send-email-ulf.hansson@linaro.org> References: <1380207292-16968-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Cc: linux-omap@vger.kernel.org Signed-off-by: Ulf Hansson --- 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