Thread (10 messages) flat view 10 messages, 3 authors, 2011-02-11
STALE5678d

[PATCH 1/5] mmc: sdhci-esdhc-imx: add support for write protect on custom GPIO

From: Wolfram Sang <hidden>
Date: 2011-02-11 09:42:48
Also in: linux-mmc

Marc,

On Fri, Feb 11, 2011 at 09:24:38AM +1100, Marc Reilly wrote:
Tested-by: Marc Reilly <redacted> 
Thanks a lot!
quoted
+	if (boarddata) {
Perhaps (boarddata && gpio_is_valid(boarddata->wp_gpio) as above?

For example what if someone sets up the boarddata for a card detect, but not 
write protect.
Well, I couldn't do this here, because later the cd_pin-stuff will also
be added to the if-block. However, I see what you mean and that could
still be added before the gpio_request below. That would add another
level of indentation, though, for a case I'd consider to be more
theoretical (and definately not recommended). Maybe I will adjust the
warning message to be also understandable for the case a GPIO is preset
with an invalid number. I think the warning itself is justified.
quoted
+		err = gpio_request_one(boarddata->wp_gpio, GPIOF_IN, "ESDHC_WP");
+		if (err) {
+			dev_warn(mmc_dev(host->mmc), "can't get wp_pin!\n");
+			boarddata->wp_gpio = err;
+		}
+	}
Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help