Re: [PATCH 1/2] gpio: rdc321x: Fix off-by-one for ngpio setting

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

 



On Fri, Apr 11, 2014 at 8:14 AM, Axel Lin <axel.lin@xxxxxxxxxx> wrote:

> The valid gpio is GPIO0 ~ GPIO58, so ngpio should be RDC321X_MAX_GPIO + 1.
>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
(...)
> -       rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios;
> +       rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios + 1;

This is counter-intuitive. "max_gpios" should be a name for the
maximum number of gpios right? Not the maximum number of
GPIOs minus one!

It is better to patch include/linux/mfd/rdc321x.h:

-#define RDC321X_MAX_GPIO    58
+#define RDC321X_MAX_GPIO    59

Which establishes the true character of this device.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux