[U-Boot] [PATCH 2/2] mmc: omap_hsmmc.c: only register getcd/getwp callbacks if gpio could be used
Peter Korsgaard
jacmet at sunsite.dk
Thu Mar 21 15:43:46 CET 2013
>>>>> "Tom" == Tom Rini <trini at ti.com> writes:
priv_data-> cd_gpio = omap_mmc_setup_gpio_in(cd_gpio, "mmc_cd");
>> + if (priv_data->cd_gpio != -1)
>> + mmc->getcd = omap_mmc_getcd;
>> +
priv_data-> wp_gpio = omap_mmc_setup_gpio_in(wp_gpio, "mmc_wp");
>> + if (priv_data->wp_gpio != -1)
>> + mmc->getwp = omap_mmc_getwp;
>> +
Tom> OK, but this should be gpio_is_valid rather than != -1, and then this is
Tom> probably a better way than my series.
Well, omap_mmc_setup_gpio_in() explicitly return -1 on errors (could be
a valid gpio, just already reserved or unable to make input).
--
Bye, Peter Korsgaard
More information about the U-Boot
mailing list