From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Wed, 20 Mar 2013 14:41:37 -0400 Subject: [U-Boot] [PATCH] omap_hsmmc: Check wp and cd GPIO for -1 In-Reply-To: References: <1363804332-10828-1-git-send-email-trini@ti.com> Message-ID: <20130320184137.GL25919@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 Wed, Mar 20, 2013 at 03:37:10PM -0300, Fabio Estevam wrote: > On Wed, Mar 20, 2013 at 3:32 PM, Tom Rini wrote: > > > int cd_gpio = ((struct omap_hsmmc_data *)mmc->priv)->cd_gpio; > > - return gpio_get_value(cd_gpio); > > + > > + if (cd_gpio >= 0) > > What about using gpio_is_valid(cd_gpio) ? OK, good point. > > + return gpio_get_value(cd_gpio); > > + else > > + return -1; > > What about -EINVAL? Not consistent with the rest of the driver, so I'll do that in a 2/2. Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: