From: Tom Rini Date: Thu, 21 Mar 2013 10:49:32 -0400 Subject: [U-Boot] [PATCH 2/2] mmc: omap_hsmmc.c: only register getcd/getwp callbacks if gpio could be used In-Reply-To: <87mwtwq0d9.fsf@dell.be.48ers.dk> References: <1363874404-7356-1-git-send-email-peter.korsgaard@barco.com> <1363874404-7356-2-git-send-email-peter.korsgaard@barco.com> <20130321142206.GC26945@bill-the-cat> <87mwtwq0d9.fsf@dell.be.48ers.dk> Message-ID: <20130321144932.GH26945@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Mar 21, 2013 at 03:43:46PM +0100, Peter Korsgaard wrote: > >>>>> "Tom" == Tom Rini 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). Ah, OK, that works. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: