From patchwork Thu Jun 9 07:10:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 9166339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3CA1604DB for ; Thu, 9 Jun 2016 07:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 951542830C for ; Thu, 9 Jun 2016 07:11:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89B9A28326; Thu, 9 Jun 2016 07:11:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 446262830C for ; Thu, 9 Jun 2016 07:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162058AbcFIHLf (ORCPT ); Thu, 9 Jun 2016 03:11:35 -0400 Received: from down.free-electrons.com ([37.187.137.238]:46287 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1162055AbcFIHLa (ORCPT ); Thu, 9 Jun 2016 03:11:30 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 811D6466; Thu, 9 Jun 2016 09:11:28 +0200 (CEST) Received: from localhost (81-67-231-93.rev.numericable.fr [81.67.231.93]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4D44F1BC; Thu, 9 Jun 2016 09:11:28 +0200 (CEST) From: Gregory CLEMENT To: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org Cc: Rob Herring , devicetree@vger.kernel.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory CLEMENT , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Nadav Haklai , Victor Gu , Romain Perier , Omri Itach , Marcin Wojtas , Wilson Ding , Shadi Ammouri Subject: [PATCH 07/12] mmc: core: export the alive operation Date: Thu, 9 Jun 2016 09:10:13 +0200 Message-Id: <1465456218-28354-8-git-send-email-gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1465456218-28354-1-git-send-email-gregory.clement@free-electrons.com> References: <1465456218-28354-1-git-send-email-gregory.clement@free-electrons.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Depending of the type of card there is a different operation to know if the car is alive. However, the access to this operation are private. This patch introduce a new function allowing to know if the card is alive by using the appropriate operation. Signed-off-by: Gregory CLEMENT --- drivers/mmc/core/core.c | 7 +++++++ include/linux/mmc/card.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8b4dfd45433b..3dce095c5f89 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2464,6 +2464,13 @@ int mmc_hw_reset(struct mmc_host *host) } EXPORT_SYMBOL(mmc_hw_reset); + +int card_alive(struct mmc_card *card) +{ + return card->host->bus_ops->alive(card->host); +} +EXPORT_SYMBOL(card_alive); + static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) { host->f_init = freq; diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index eb0151bac50c..287a0b12d8ba 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -526,6 +526,7 @@ struct mmc_driver { void (*shutdown)(struct mmc_card *); }; +extern int card_alive(struct mmc_card *); extern int mmc_register_driver(struct mmc_driver *); extern void mmc_unregister_driver(struct mmc_driver *);