| .. | .. |
|---|
| 79 | 79 | static int __init mvebu_armada_pm_init(void) |
|---|
| 80 | 80 | { |
|---|
| 81 | 81 | struct device_node *np; |
|---|
| 82 | | - struct device_node *gpio_ctrl_np; |
|---|
| 82 | + struct device_node *gpio_ctrl_np = NULL; |
|---|
| 83 | 83 | int ret = 0, i; |
|---|
| 84 | 84 | |
|---|
| 85 | 85 | if (!of_machine_is_compatible("marvell,axp-gp")) |
|---|
| .. | .. |
|---|
| 126 | 126 | goto out; |
|---|
| 127 | 127 | } |
|---|
| 128 | 128 | |
|---|
| 129 | + if (gpio_ctrl_np) |
|---|
| 130 | + of_node_put(gpio_ctrl_np); |
|---|
| 129 | 131 | gpio_ctrl_np = args.np; |
|---|
| 130 | 132 | pic_raw_gpios[i] = args.args[0]; |
|---|
| 131 | 133 | } |
|---|
| 132 | 134 | |
|---|
| 133 | 135 | gpio_ctrl = of_iomap(gpio_ctrl_np, 0); |
|---|
| 134 | | - if (!gpio_ctrl) |
|---|
| 135 | | - return -ENOMEM; |
|---|
| 136 | + if (!gpio_ctrl) { |
|---|
| 137 | + ret = -ENOMEM; |
|---|
| 138 | + goto out; |
|---|
| 139 | + } |
|---|
| 136 | 140 | |
|---|
| 137 | 141 | mvebu_pm_suspend_init(mvebu_armada_pm_enter); |
|---|
| 138 | 142 | |
|---|
| 139 | 143 | out: |
|---|
| 140 | 144 | of_node_put(np); |
|---|
| 145 | + of_node_put(gpio_ctrl_np); |
|---|
| 141 | 146 | return ret; |
|---|
| 142 | 147 | } |
|---|
| 143 | 148 | |
|---|