diff mbox

[RFC,2/5] mcu_mpc8349emitx: port to new of gpio interface

Message ID 1258472546-31343-3-git-send-email-dbaryshkov@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Grant Likely
Headers show

Commit Message

Dmitry Baryshkov Nov. 17, 2009, 3:42 p.m. UTC
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

Comments

Kumar Gala Dec. 9, 2009, 9:16 p.m. UTC | #1
On Nov 17, 2009, at 9:42 AM, Dmitry Eremin-Solenikov wrote:

> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |   11 +++++------
> 1 files changed, 5 insertions(+), 6 deletions(-)

Minding reviewing for me.

- k

> 
> diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
> index 82a9bcb..4ba8b16 100644
> --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
> +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
> @@ -36,7 +36,7 @@ struct mcu {
> 	struct mutex lock;
> 	struct device_node *np;
> 	struct i2c_client *client;
> -	struct of_gpio_chip of_gc;
> +	struct gpio_chip gc;
> 	u8 reg_ctrl;
> };
> 
> @@ -55,8 +55,7 @@ static void mcu_power_off(void)
> 
> static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
> {
> -	struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
> -	struct mcu *mcu = container_of(of_gc, struct mcu, of_gc);
> +	struct mcu *mcu = container_of(gc, struct mcu, gc);
> 	u8 bit = 1 << (4 + gpio);
> 
> 	mutex_lock(&mcu->lock);
> @@ -78,8 +77,8 @@ static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
> static int mcu_gpiochip_add(struct mcu *mcu)
> {
> 	struct device_node *np;
> -	struct of_gpio_chip *of_gc = &mcu->of_gc;
> -	struct gpio_chip *gc = &of_gc->gc;
> +	struct gpio_chip *gc = &mcu->gc;
> +	struct of_gpio_chip *of_gc = &gc->of_gc;
> 	int ret;
> 
> 	np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx");
> @@ -113,7 +112,7 @@ static int mcu_gpiochip_remove(struct mcu *mcu)
> {
> 	int ret;
> 
> -	ret = gpiochip_remove(&mcu->of_gc.gc);
> +	ret = gpiochip_remove(&mcu->gc);
> 	if (ret)
> 		return ret;
> 	of_node_put(mcu->np);
> -- 
> 1.6.5
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
Anton Vorontsov Dec. 9, 2009, 9:32 p.m. UTC | #2
On Wed, Dec 09, 2009 at 03:16:37PM -0600, Kumar Gala wrote:
> On Nov 17, 2009, at 9:42 AM, Dmitry Eremin-Solenikov wrote:
> 
> > Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> > ---
> > arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |   11 +++++------
> > 1 files changed, 5 insertions(+), 6 deletions(-)
> 
> Minding reviewing for me.

The whole approach was reviewed, and rejected.

http://lists.ozlabs.org/pipermail/devicetree-discuss/2009-November/001330.html
and
http://lists.ozlabs.org/pipermail/devicetree-discuss/2009-November/001328.html

Thanks,
diff mbox

Patch

diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 82a9bcb..4ba8b16 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -36,7 +36,7 @@  struct mcu {
 	struct mutex lock;
 	struct device_node *np;
 	struct i2c_client *client;
-	struct of_gpio_chip of_gc;
+	struct gpio_chip gc;
 	u8 reg_ctrl;
 };
 
@@ -55,8 +55,7 @@  static void mcu_power_off(void)
 
 static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
-	struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
-	struct mcu *mcu = container_of(of_gc, struct mcu, of_gc);
+	struct mcu *mcu = container_of(gc, struct mcu, gc);
 	u8 bit = 1 << (4 + gpio);
 
 	mutex_lock(&mcu->lock);
@@ -78,8 +77,8 @@  static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
 static int mcu_gpiochip_add(struct mcu *mcu)
 {
 	struct device_node *np;
-	struct of_gpio_chip *of_gc = &mcu->of_gc;
-	struct gpio_chip *gc = &of_gc->gc;
+	struct gpio_chip *gc = &mcu->gc;
+	struct of_gpio_chip *of_gc = &gc->of_gc;
 	int ret;
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx");
@@ -113,7 +112,7 @@  static int mcu_gpiochip_remove(struct mcu *mcu)
 {
 	int ret;
 
-	ret = gpiochip_remove(&mcu->of_gc.gc);
+	ret = gpiochip_remove(&mcu->gc);
 	if (ret)
 		return ret;
 	of_node_put(mcu->np);