[alsa-devel] [PATCH v4 7/9] davinci: MMC/SD support for Omapl138-Hawkboar

Victor Rodriguez vm.rod25 at gmail.com
Tue Oct 19 19:15:45 CEST 2010


On Tue, Oct 19, 2010 at 6:02 AM, Cyril Chemparathy <cyril at ti.com> wrote:
> Hi Victor,
>
> [...]
>> Yes you are right and as I understand gpio_request will give a 0 if it
>> success and because of that the warning never will appear, if there is
>> a problem there will be a -1 and the warning will be printed. I could
>> fix this with a return that breaks the code like this
>>
>>        ret = gpio_request(DA850_HAWK_MMCSD_CD_PIN, "MMC CD\n");
>>        if (ret) {
>>                pr_warning("%s: can not open GPIO %d\n",
>>                        __func__, DA850_HAWK_MMCSD_CD_PIN);
>>                return;
>>        }
>>        gpio_direction_input(DA850_HAWK_MMCSD_CD_PIN);
>
> I think gpio_request_one() is simpler.  This requests the gpio and sets
> it up:
>
>        ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN,
>                               GPIOF_DIR_IN, "MMC CD");
>        if (ret < 0) {
>                ... failed ...
>        }
>
> Regards
> Cyril.
>

Thanks works perfect

Regards

Victor Rodriguez


More information about the Alsa-devel mailing list