[PATCH v3] gpio: gpio-pca953x: no interrupts with 4-bit devices

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

 



Ah, I didn't know about DIV_ROUND_UP(). I also didn't read Alexander's response correctly. Sorry about that. DIV_ROUND_UP() is essentially what he proposed, and it's also correct for ngpio==0.

So here's the third version of my trivial patch.

Signed-off-by: Frank Edelhaeuser <mrpace2 <at> gmail.com>
---
diff -Nur a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
--- a/drivers/gpio/gpio-pca953x.c 2016-03-10 19:11:37.799908602 +0000
+++ b/drivers/gpio/gpio-pca953x.c 2016-03-10 19:11:09.635412539 +0000
@@ -86,7 +86,7 @@
 #define MAX_BANK 5
 #define BANK_SZ 8

-#define NBANK(chip) (chip->gpio_chip.ngpio / BANK_SZ)
+#define NBANK(chip) (DIV_ROUND_UP(chip->gpio_chip.ngpio, BANK_SZ))

 struct pca953x_chip {
  unsigned gpio_start;


--
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