Re: [PATCH] tmio_mmc_pio: test TMIO_MMC_WRPROTECT_DISABLE earlier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[...]

>>>     Looking at the code, the following fragment of mmc_attach_sd()
>>> doesn't
>>> make much sense to me:
>>>
>>>          mmc_release_host(host);
>>>          err = mmc_add_card(host->card);
>>>          mmc_claim_host(host);
>>>          if (err)
>>>                  goto remove_card;
>>>
>>>          return 0;
>>>
>>> remove_card:
>>>          mmc_release_host(host);
>>>          mmc_remove_card(host->card);
>>>          host->card = NULL;
>>>          mmc_claim_host(host);
>>>
>>>     Why claim the host and immediately release it on mmc_add_card()
>>> error?
>>> Can we only claim on success and save a call here?
>
>
>> You are right, we can simplify the sequence!
>
>
>    OK, what about calling mmc_remove_card() on mmc_add_card() failure?
> Isn't it also superfluous?

Nope.

Kind regards
Uffe
--
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



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux