lkml.org 
[lkml]   [2013]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/4] pinctrl: abx500: suppress hardcoded value
From
On Thu, Jun 20, 2013 at 4:05 PM,  <patrice.chotard.st@gmail.com> wrote:

> From: Patrice Chotard <patrice.chotard@st.com>
>
> Replace hardcoded value by corresponding #define's.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

This is not so good. The commit message is saying it
replaces values by #defines but is actually replacing it
by an enum.

Then you're in each instance calling

abx500_gpio_set_bits(struct gpio_chip *chip, u8 reg,
unsigned offset, int val)

The last argument is a hardware register value, but here you
case an enum abx500_gpio_direction to an integer and pass
to this function.

It would be better if the patch did what it says: create a
#define for ABX500_GPIO_INPUT and ABX500_GPIO_OUTPUT
locally in drivers/pinctrl/pinctrl-abx500.c and use it locally
instead of touching <mfd/abx500/ab8500-gpio.h>.

Thanks,
Linus Walleij


\
 
 \ /
  Last update: 2013-06-24 14:01    [W:0.130 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site