Thread (17 messages) 17 messages, 4 authors, 2012-08-08

Re: [rtc-linux] [PATCH 8/8] ARM: vt8500: gpio: Devicetree support for arch-vt8500

From: Linus Walleij <hidden>
Date: 2012-08-08 14:28:29
Also in: linux-arm-kernel, linux-devicetree, linux-fbdev, lkml

On Wed, Aug 8, 2012 at 11:19 AM, Arnd Bergmann [off-list ref] wrote:
quoted
What on earth are all those magic numbers?

I *guess* they're enabling some default GPIO settings etc.
No, they are the register offsets you quoted above, per bank.
Aha I was fooled by this:

+struct vt8500_gpio_bank_regs {
+       int     en;
+       int     dir;
+       int     data_out;
+       int     data_in;
+       int     ngpio;
+};

This needs to be named something intuitive like "vt8500_gpio_bank_regoffsets"

Some kerneldoc intsead of the opaque comment above will also improve
readability a lot:

/**
  * struct vt8500_gpio_bank_regoffsets
  * @en: offset to enable register in the bank
  * ...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help