[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200810171324.42650.david-b@pacbell.net>
Date: Fri, 17 Oct 2008 13:24:42 -0700
From: David Brownell <david-b@...bell.net>
To: Anton Vorontsov <avorontsov@...mvista.com>
Cc: linux-kernel@...r.kernel.org,
David Brownell <dbrownell@...rs.sourceforge.net>,
"Steven A. Falco" <sfalco@...ris.com>,
Grant Likely <grant.likely@...retlab.ca>,
Jean Delvare <khali@...ux-fr.org>,
David Miller <davem@...emloft.net>, i2c@...sensors.org,
linuxppc-dev@...abs.org
Subject: Re: [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls
On Thursday 16 October 2008, Anton Vorontsov wrote:
> +/*
> + * Platforms can define their own __dev_ versions to glue gpio_chips with the
> + * architecture-specific code.
> + */
> +#ifndef __dev_gpiochip_add
> +#define __dev_gpiochip_add __dev_gpiochip_add
> +static inline int __dev_gpiochip_add(struct device *dev,
> + struct gpio_chip *chip)
> +{
> + chip->dev = dev;
> + return gpiochip_add(chip);
> +}
> +#endif /* __dev_gpiochip_add */
This is pretty ugly, especially the implication that *EVERY* gpio_chip
provider needs modification to use these calls.
Surely it would be a lot simpler to just add platform-specific hooks
to gpiochip_{add,remove}(), so that no providers need to be changed??
> +#ifndef __dev_gpiochip_remove
> +#define __dev_gpiochip_remove __dev_gpiochip_remove
> +static inline int __dev_gpiochip_remove(struct device *dev,
> + struct gpio_chip *chip)
> +{
> + return gpiochip_remove(chip);
> +}
> +#endif /* __dev_gpiochip_remove */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists