Marc, On Fri, Feb 11, 2011 at 09:24:38AM +1100, Marc Reilly wrote: > Tested-by: Marc Reilly <marc@xxxxxxxxxxxxxxx> Thanks a lot! > > + 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. > > > + 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/ | -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html