[U-Boot] [PATCH 1/4] mmc: Change board_mmc_getcd() signature.
Thierry Reding
thierry.reding at avionic-design.de
Mon Dec 5 13:53:37 CET 2011
* Stefano Babic wrote:
> On 05/12/2011 09:23, Thierry Reding wrote:
[...]
> > diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
> > index b78bf6c..451d709 100644
> > --- a/board/efikamx/efikamx.c
> > +++ b/board/efikamx/efikamx.c
> > @@ -309,17 +309,15 @@ static inline uint32_t efika_mmc_cd(void)
> > return MX51_PIN_EIM_CS2;
> > }
> >
> > -int board_mmc_getcd(u8 *absent, struct mmc *mmc)
> > +int board_mmc_getcd(struct mmc *mmc)
> > {
> > struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
> > uint32_t cd = efika_mmc_cd();
> >
> > if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
> > - *absent = gpio_get_value(IOMUX_TO_GPIO(cd));
> > - else
> > - *absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8));
> > + return !gpio_get_value(IOMUX_TO_GPIO(cd));
>
> It seems to me you are inverting the logic. In you commit message, "1"
> means that a card is detected, exactly as it is done now. Am I wrong ?
The reason is that the fsl_esdhc driver actually calls the "cd" parameter
"absent", so the logic is inverted in that driver. This change merely brings
the board implementation in line with the new API. Perhaps it would help if
the meaning of the return value should be documented explicitly in mmc.h?
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111205/507f6776/attachment.pgp>
More information about the U-Boot
mailing list