Re: [patch 13/20] chardev: GPIO for PC8736x: finally!

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

 



(hmm, patch 12/20 seems to be missing)

On 12/06/06, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:

add new pc8736x_gpio driver, based upon the new-improved scx200_gpio driver

+/* static u8 pc8736x_gpio_shadow[4]; */

If this is not needed and commented out, why include it at all?


[snip]
+static inline void sio_outb(int addr, int val)
+{
+       outb_p(addr, sio_cmd);
+       outb_p(val, sio_cmd + 1);
+}
+static inline int sio_inb(int addr)
+{
+       outb_p(addr, sio_cmd);
+       return inb_p(sio_cmd + 1);
+}

A blank line between these two functions please :)


[snip]
+               if (sio_inb(SIO_SID) != SIO_SID_VALUE) {
+                       sio_cmd = 0;
+               }

No curly braces when there's only a single statement inside the "if", please.


[snip]
+/** add this soon
+
+static u32 pc8736x_gpio_configure_event(unsigned index, u32 mask, u32 bits)
+{
+       return pc8736x_gpio_configure_fn(index, mask, bits,
+                                        SIO_GPIO_PIN_EVENT);
+}
+**/

If it's not needed now, why not just delay it's inclusion until it
really is needed?


+static void pc8736x_gpio_set_high(unsigned index)
+{
+       pc8736x_gpio_set(index, 1);
+}
+
+static void pc8736x_gpio_set_low(unsigned index)
+{
+       pc8736x_gpio_set(index, 0);
+}
+
+static int pc8736x_gpio_current(unsigned index)
+{
+       printk(KERN_WARNING NAME ": pc8736x_gpio_current unimplemented\n");
+       return 0;
+}
+
+static void pc8736x_gpio_change(unsigned index)
+{
+       pc8736x_gpio_set(index, !pc8736x_gpio_get(index));
+}
+

Perhaps make these inline?
Dunno if it'll make sense, but they just look like obvious inline candidates :)


--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux