diff options
Diffstat (limited to 'arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c')
-rw-r--r-- | arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index d119a7c1c17..e49f4bd2f99 100644 --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | |||
@@ -37,7 +37,7 @@ struct mcu { | |||
37 | struct mutex lock; | 37 | struct mutex lock; |
38 | struct device_node *np; | 38 | struct device_node *np; |
39 | struct i2c_client *client; | 39 | struct i2c_client *client; |
40 | struct of_gpio_chip of_gc; | 40 | struct gpio_chip gc; |
41 | u8 reg_ctrl; | 41 | u8 reg_ctrl; |
42 | }; | 42 | }; |
43 | 43 | ||
@@ -56,8 +56,7 @@ static void mcu_power_off(void) | |||
56 | 56 | ||
57 | static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) | 57 | static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) |
58 | { | 58 | { |
59 | struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); | 59 | struct mcu *mcu = container_of(gc, struct mcu, gc); |
60 | struct mcu *mcu = container_of(of_gc, struct mcu, of_gc); | ||
61 | u8 bit = 1 << (4 + gpio); | 60 | u8 bit = 1 << (4 + gpio); |
62 | 61 | ||
63 | mutex_lock(&mcu->lock); | 62 | mutex_lock(&mcu->lock); |
@@ -79,8 +78,7 @@ static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | |||
79 | static int mcu_gpiochip_add(struct mcu *mcu) | 78 | static int mcu_gpiochip_add(struct mcu *mcu) |
80 | { | 79 | { |
81 | struct device_node *np; | 80 | struct device_node *np; |
82 | struct of_gpio_chip *of_gc = &mcu->of_gc; | 81 | struct gpio_chip *gc = &mcu->gc; |
83 | struct gpio_chip *gc = &of_gc->gc; | ||
84 | int ret; | 82 | int ret; |
85 | 83 | ||
86 | np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx"); | 84 | np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx"); |
@@ -94,10 +92,9 @@ static int mcu_gpiochip_add(struct mcu *mcu) | |||
94 | gc->base = -1; | 92 | gc->base = -1; |
95 | gc->set = mcu_gpio_set; | 93 | gc->set = mcu_gpio_set; |
96 | gc->direction_output = mcu_gpio_dir_out; | 94 | gc->direction_output = mcu_gpio_dir_out; |
97 | of_gc->gpio_cells = 2; | 95 | gc->of_gpio_n_cells = 2; |
98 | of_gc->xlate = of_gpio_simple_xlate; | 96 | gc->of_xlate = of_gpio_simple_xlate; |
99 | 97 | ||
100 | np->data = of_gc; | ||
101 | mcu->np = np; | 98 | mcu->np = np; |
102 | 99 | ||
103 | /* | 100 | /* |
@@ -114,7 +111,7 @@ static int mcu_gpiochip_remove(struct mcu *mcu) | |||
114 | { | 111 | { |
115 | int ret; | 112 | int ret; |
116 | 113 | ||
117 | ret = gpiochip_remove(&mcu->of_gc.gc); | 114 | ret = gpiochip_remove(&mcu->gc); |
118 | if (ret) | 115 | if (ret) |
119 | return ret; | 116 | return ret; |
120 | of_node_put(mcu->np); | 117 | of_node_put(mcu->np); |