On Sat, Jan 01, 2011 at 04:28:46PM -0800, Olof Johansson wrote: > On Thu, Dec 23, 2010 at 3:23 AM, Wolfram Sang <w.sang@xxxxxxxxxxxxxx> wrote: > > > >> Changes since v2: > >> * Whitespace fixes > >> * Changed order of test in get_ro > > > > What benefit has the reordering? (And just to make sure: You still > > return -1 meaning "read-only". I assume this is intentional) > > Looking at drivers/mmc/core/sd.c:mmc_sd_setup_card(), returning <0 > means no RO detection, and will print a warning to that effect. If no > other RO-related quirks are included (i.e. such as > SDHCI_QUIRK_INVERTED_WRITE_PROTECT), the value will be passed up > through sdhci_get_ro and thus handled appropriately. > > So on second look the code as it is seems correct to me. ACK. I misread the code before :( No wonder my comment seemed vague to you, sorry for that. I agree that the code is correct and the reordering helps readability. The only nitpick I'd have now is to return -ESOMETHING (-EINVAL?) instead of -1 to make the fault more obvious. Kind regards, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Attachment:
signature.asc
Description: Digital signature