From patchwork Mon Jun 10 15:03:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 17739 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f198.google.com (mail-gg0-f198.google.com [209.85.161.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CDFAF2397B for ; Mon, 10 Jun 2013 15:04:22 +0000 (UTC) Received: by mail-gg0-f198.google.com with SMTP id p4sf3954384ggn.5 for ; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=lQcYNNeHWXUgJFwfKX9EEhSi8/zlQ3DHBBSSjqwtXWQ=; b=HhBzaqhb0LjHOdZPFmEbrhZIYjXIl+kplISnACESgcAe9gieHX6bmQ0LhzJRgLTvdO +yyFtVEweM8V/Y0utcC9pDwKlBRSdJrScq4F39FdS3bWd4hnOabdwAeDKfRnNUhSQbNy YBx2LvWOQ1TUvV5IL53O9y/ELCfw8WMrvQQqpqToB3Ikz2dz/hgPFVr+7ixSTAN1hVkB OmYAxMJJQV4mqD6p/h8i8aZ4F/ja5y28G3sRkKCBzdcPl6ECJMI80tpRVnr6/A9vqoea GZhyDJMIfhlB5QXowJq0Dl8t0Ru9/CZGnOXfUV1boirHCBwd3h+U8xhlhCjujKyw3NFr mA/w== X-Received: by 10.58.75.169 with SMTP id d9mr1533752vew.14.1370876662533; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.103.132 with SMTP id fw4ls2747414qeb.17.gmail; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) X-Received: by 10.52.29.142 with SMTP id k14mr4905993vdh.124.1370876662327; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id p8si5068107vdv.44.2013.06.10.08.04.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id ib11so4487491vcb.31 for ; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) X-Received: by 10.58.106.77 with SMTP id gs13mr5863645veb.22.1370876662212; Mon, 10 Jun 2013 08:04:22 -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.221.10.206 with SMTP id pb14csp71492vcb; Mon, 10 Jun 2013 08:04:21 -0700 (PDT) X-Received: by 10.14.178.134 with SMTP id f6mr11605340eem.91.1370876660398; Mon, 10 Jun 2013 08:04:20 -0700 (PDT) Received: from eu1sys200aog114.obsmtp.com (eu1sys200aog114.obsmtp.com [207.126.144.137]) by mx.google.com with SMTP id o46si8567627eef.35.2013.06.10.08.04.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:20 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.137 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.137; Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKUbXq7+7iKa5XcSOoYItqP2OBqbO1cXPJ@postini.com; Mon, 10 Jun 2013 15:04:20 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id E5930BC; Mon, 10 Jun 2013 15:04:12 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id A1AB79C0; Mon, 10 Jun 2013 15:04:12 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 0A3F524C2C0; Mon, 10 Jun 2013 17:04:04 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 10 Jun 2013 17:04:11 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [PATCH 06/12] mmc: core: Extend shutdown sequence to handle bus operations Date: Mon, 10 Jun 2013 17:03:41 +0200 Message-ID: <1370876627-13439-7-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> References: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnqXNy4vmmsT6KbPrOCb2c1iKo7JEXRZPHHmladZD2xGprb67lM/7YlVY4EAdLeKOohMY+2 X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 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: , From: Ulf Hansson By adding an optional .shutdown callback to the bus_ops struct we provide the possibility to let each bus type handle it's shutdown requirements. Signed-off-by: Ulf Hansson --- drivers/mmc/core/bus.c | 9 +++++++++ drivers/mmc/core/core.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 219bf4b..4c0decf 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -126,8 +126,17 @@ static void mmc_bus_shutdown(struct device *dev) { struct mmc_driver *drv = to_mmc_driver(dev->driver); struct mmc_card *card = mmc_dev_to_card(dev); + struct mmc_host *host = card->host; + int ret; drv->shutdown(card); + + if (host->bus_ops->shutdown) { + ret = host->bus_ops->shutdown(host); + if (ret) + pr_warn("%s: error %d during shutdown\n", + mmc_hostname(host), ret); + } } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 79f37cf..5345d15 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -26,6 +26,7 @@ struct mmc_bus_ops { int (*power_save)(struct mmc_host *); int (*power_restore)(struct mmc_host *); int (*alive)(struct mmc_host *); + int (*shutdown)(struct mmc_host *); }; void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);