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

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

 



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.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux