Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Walker
Date: Tuesday, November 23, 2010 - 10:51 am

On Thu, 2010-11-18 at 11:52 -0800, Gregory Bean wrote:

It looks like your actually doing more than what stated here. Like your
adding pm related structure which shouldn't be needed for just the
irq_chip.

more comments below,


This is a little bit inconsistent .. Your using BIT() in this case, but
there are other cases where you define which bit and use BIT() in the
code.


It seems these functions actually accept output from BIT(). It would be
safer to force these to accept the bit number then use BIT() inside this
function to translate. That way you wouldn't use "unsigned n" for the
argument you would use a named enum for the argument.


so in this case you just send in GPIO_OE_BIT , but you also need 
GPIO_OE_BIT to be part of the same enum as all the other bits sent to
clr_gpio_bits/set_gpio_bits. I'd just use "clear_gpio_bits" for the
name, doesn't look like there's a good reason to shorten it.


Not chip->base + offset?


I guess it's fine to do "offset - chip->base" if base is always zero,
but why do subtraction at all.


You could set pr_fmt so it automatically adds the __func__ prefix.
Assuming you planned on adding more of these.


I's just break this into two calls, or make another helper that to set
that accepts the mask and have set_gpio_bits call that. This here you
would just use the other helper. like set_gpio_bits calls
set_gpio_bits_mask() and you call the mask version here.


Then this I'd do a whole other patch for. Can this get used yet tho?

Daniel

-- 
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Gregory Bean, (Thu Nov 18, 12:52 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Thu Nov 18, 12:59 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Thu Nov 18, 1:39 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Thu Nov 18, 3:02 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Fri Nov 19, 11:49 am)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Fri Nov 19, 12:09 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Daniel Walker, (Tue Nov 23, 10:51 am)