All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Changming-R66093 <r66093@freescale.com>
To: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Girish K S <girish.shivananjappa@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Anton Vorontsov <cbouatmailru@gmail.com>,
	Chris Ball <cjb@laptop.org>
Subject: RE: [PATCH 2/4 v4] MMC/SD: Add callback function to detect card
Date: Wed, 31 Oct 2012 05:52:18 +0000	[thread overview]
Message-ID: <110EED8CC96DFC488B7E717A2027A27C204553@039-SN1MPN1-003.039d.mgd.msft.net> (raw)
In-Reply-To: <5090A927.2050708@samsung.com>



Best Regards
Jerry Huang


> -----Original Message-----
> From: Jaehoon Chung [mailto:jh80.chung@samsung.com]
> Sent: Wednesday, October 31, 2012 12:29 PM
> To: Huang Changming-R66093
> Cc: Girish K S; linux-mmc@vger.kernel.org; Anton Vorontsov; Chris Ball
> Subject: Re: [PATCH 2/4 v4] MMC/SD: Add callback function to detect card
> 
> Hi,
> 
> >> *host)
> >>>         if (!host->card || mmc_card_removed(host->card))
> >>>                 return 1;
> >>>
> >>> -       ret = host->bus_ops->alive(host);
> >>> +       if (host->ops->get_cd) {
> >>> +               ret = host->ops->get_cd(host);
> >>> +               if (ret >= 0)
> >>> +                       ret = !ret;
> >>> +       }
> >>> +       if (ret < 0)
> >>> +               ret = host->bus_ops->alive(host);
> >> why should we check for negative here? can move this code into else
> >> path of   if (host->ops->get_cd).
> >>>         if (ret) {
> >
> > I did this comment:
> > If the card is present, 1 will return, if the card is absent, 0 will
> return.
> > If the controller will not support this feature, -ENOSYS will return.
> If checked whether card is absent or not with get_cd(), need to check the
> host->bus_ops->alive?

When get_cd is not supported, need to check it.


  reply	other threads:[~2012-10-31  5:52 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30  8:12 [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() r66093
2012-10-30  8:12 ` [PATCH 2/4 v4] MMC/SD: Add callback function to detect card r66093
2012-10-30  8:12   ` [PATCH 3/4 v5] SDHCI: add sdhci_get_cd callback to detect the card r66093
2012-10-30  8:12     ` [PATCH 4/4 v4] ESDHC: add callback esdhc_of_get_cd to detect card r66093
2012-11-19  2:50       ` Huang Changming-R66093
2012-11-19  2:54         ` Anton Vorontsov
2012-11-19  2:50     ` [PATCH 3/4 v5] SDHCI: add sdhci_get_cd callback to detect the card Huang Changming-R66093
2012-11-19  2:58       ` Anton Vorontsov
2012-11-19  3:15         ` Huang Changming-R66093
2012-11-19  3:31           ` Anton Vorontsov
2012-11-19  3:38             ` Huang Changming-R66093
2012-10-30 11:34   ` [PATCH 2/4 v4] MMC/SD: Add callback function to detect card Girish K S
2012-10-31  2:23     ` Huang Changming-R66093
2012-10-31  4:29       ` Jaehoon Chung
2012-10-31  5:52         ` Huang Changming-R66093 [this message]
2012-11-01 15:57   ` Johan Rudholm
2012-11-02  1:37     ` Huang Changming-R66093
2012-11-02 10:33       ` Johan Rudholm
2012-11-05  3:17         ` Huang Changming-R66093
2012-11-05 14:07           ` Johan Rudholm
2012-11-06  1:55             ` Huang Changming-R66093
2012-11-06  1:55             ` Huang Changming-R66093
2012-11-13  7:50               ` Huang Changming-R66093
2012-11-19  2:48             ` Huang Changming-R66093
2012-11-19  3:05   ` Anton Vorontsov
2012-11-19  3:11     ` Huang Changming-R66093
2012-10-30 23:08 ` [PATCH 1/4 v3] MMC/core: Add f_min to mmc_power_on() Ulf Hansson
2012-10-31  2:23   ` Huang Changming-R66093
2012-10-31  4:21   ` Jaehoon Chung
  -- strict thread matches above, loose matches on Subject: below --
2011-12-27  8:00 [PATCH 2/4 v4] MMC/SD: Add callback function to detect card r66093
2012-01-13  2:25 ` Huang Changming-R66093
2012-01-13  3:26   ` Aaron Lu
2012-01-13  4:52     ` Huang Changming-R66093
2012-01-13  6:27       ` Aaron Lu
2012-01-13  7:05         ` Huang Changming-R66093
2012-01-13  7:36           ` Aaron Lu

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=110EED8CC96DFC488B7E717A2027A27C204553@039-SN1MPN1-003.039d.mgd.msft.net \
    --to=r66093@freescale.com \
    --cc=cbouatmailru@gmail.com \
    --cc=cjb@laptop.org \
    --cc=girish.shivananjappa@linaro.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-mmc@vger.kernel.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.