[PATCH v2] pxa/hx4700: use gpio arrays for global gpio initialization
Philipp Zabel
philipp.zabel at gmail.com
Thu Apr 28 16:16:43 EDT 2011
On Thu, Apr 28, 2011 at 11:05 AM, Russell King - ARM Linux
<linux at arm.linux.org.uk> wrote:
> On Wed, Apr 27, 2011 at 08:50:19PM +0200, Philipp Zabel wrote:
>> - hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
>> + ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
>> + if (ret)
>> + pr_err ("hx4700: Failed to request GPIOs.\n");
>
> No space between pr_err and (.
checkpatch issue. Sorry about that.
> Does the return code convey useful information as to _why_ it failed? If
> yes, you really should print its value. Knowing whether it's -EBUSY
> (eg, already in use) instead of -EINVAL (eg, invalid GPIO number) really
> helps to debug problems.
Yes, it does. It is certainly better to include the error code.
Recompiling with DEBUG_GPIO enabled might still be necessary to get
information about which GPIO failed, and whether -EINVAL was returned
by gpio_request() or gpio_direction_input/output().
regards
Philipp
More information about the linux-arm-kernel
mailing list