diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-11-25 04:43:15 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-12-07 09:22:49 -0500 |
commit | 538f76c566eb37f41d4406ed4c6e7ea387b7032f (patch) | |
tree | 9bcd0e7b3b2daa0230c9fd672ef86d8bb5b4527b | |
parent | 9c18be8e9342110f6ac89e5c0dc4f6380be8aaa6 (diff) |
gpio: pl061: rename state container struct
The PL061 state container is named "pl061_gpio", let's rename it
to simply pl061. Less is more.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-pl061.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 8838a44351ce..b944aaefb59f 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c | |||
@@ -50,7 +50,7 @@ struct pl061_context_save_regs { | |||
50 | }; | 50 | }; |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | struct pl061_gpio { | 53 | struct pl061 { |
54 | spinlock_t lock; | 54 | spinlock_t lock; |
55 | 55 | ||
56 | void __iomem *base; | 56 | void __iomem *base; |
@@ -64,14 +64,14 @@ struct pl061_gpio { | |||
64 | 64 | ||
65 | static int pl061_get_direction(struct gpio_chip *gc, unsigned offset) | 65 | static int pl061_get_direction(struct gpio_chip *gc, unsigned offset) |
66 | { | 66 | { |
67 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 67 | struct pl061 *chip = gpiochip_get_data(gc); |
68 | 68 | ||
69 | return !(readb(chip->base + GPIODIR) & BIT(offset)); | 69 | return !(readb(chip->base + GPIODIR) & BIT(offset)); |
70 | } | 70 | } |
71 | 71 | ||
72 | static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) | 72 | static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) |
73 | { | 73 | { |
74 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 74 | struct pl061 *chip = gpiochip_get_data(gc); |
75 | unsigned long flags; | 75 | unsigned long flags; |
76 | unsigned char gpiodir; | 76 | unsigned char gpiodir; |
77 | 77 | ||
@@ -87,7 +87,7 @@ static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) | |||
87 | static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, | 87 | static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, |
88 | int value) | 88 | int value) |
89 | { | 89 | { |
90 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 90 | struct pl061 *chip = gpiochip_get_data(gc); |
91 | unsigned long flags; | 91 | unsigned long flags; |
92 | unsigned char gpiodir; | 92 | unsigned char gpiodir; |
93 | 93 | ||
@@ -109,14 +109,14 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, | |||
109 | 109 | ||
110 | static int pl061_get_value(struct gpio_chip *gc, unsigned offset) | 110 | static int pl061_get_value(struct gpio_chip *gc, unsigned offset) |
111 | { | 111 | { |
112 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 112 | struct pl061 *chip = gpiochip_get_data(gc); |
113 | 113 | ||
114 | return !!readb(chip->base + (BIT(offset + 2))); | 114 | return !!readb(chip->base + (BIT(offset + 2))); |
115 | } | 115 | } |
116 | 116 | ||
117 | static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value) | 117 | static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value) |
118 | { | 118 | { |
119 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 119 | struct pl061 *chip = gpiochip_get_data(gc); |
120 | 120 | ||
121 | writeb(!!value << offset, chip->base + (BIT(offset + 2))); | 121 | writeb(!!value << offset, chip->base + (BIT(offset + 2))); |
122 | } | 122 | } |
@@ -124,7 +124,7 @@ static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value) | |||
124 | static int pl061_irq_type(struct irq_data *d, unsigned trigger) | 124 | static int pl061_irq_type(struct irq_data *d, unsigned trigger) |
125 | { | 125 | { |
126 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 126 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
127 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 127 | struct pl061 *chip = gpiochip_get_data(gc); |
128 | int offset = irqd_to_hwirq(d); | 128 | int offset = irqd_to_hwirq(d); |
129 | unsigned long flags; | 129 | unsigned long flags; |
130 | u8 gpiois, gpioibe, gpioiev; | 130 | u8 gpiois, gpioibe, gpioiev; |
@@ -214,7 +214,7 @@ static void pl061_irq_handler(struct irq_desc *desc) | |||
214 | unsigned long pending; | 214 | unsigned long pending; |
215 | int offset; | 215 | int offset; |
216 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 216 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
217 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 217 | struct pl061 *chip = gpiochip_get_data(gc); |
218 | struct irq_chip *irqchip = irq_desc_get_chip(desc); | 218 | struct irq_chip *irqchip = irq_desc_get_chip(desc); |
219 | 219 | ||
220 | chained_irq_enter(irqchip, desc); | 220 | chained_irq_enter(irqchip, desc); |
@@ -232,7 +232,7 @@ static void pl061_irq_handler(struct irq_desc *desc) | |||
232 | static void pl061_irq_mask(struct irq_data *d) | 232 | static void pl061_irq_mask(struct irq_data *d) |
233 | { | 233 | { |
234 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 234 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
235 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 235 | struct pl061 *chip = gpiochip_get_data(gc); |
236 | u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR); | 236 | u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR); |
237 | u8 gpioie; | 237 | u8 gpioie; |
238 | 238 | ||
@@ -245,7 +245,7 @@ static void pl061_irq_mask(struct irq_data *d) | |||
245 | static void pl061_irq_unmask(struct irq_data *d) | 245 | static void pl061_irq_unmask(struct irq_data *d) |
246 | { | 246 | { |
247 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 247 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
248 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 248 | struct pl061 *chip = gpiochip_get_data(gc); |
249 | u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR); | 249 | u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR); |
250 | u8 gpioie; | 250 | u8 gpioie; |
251 | 251 | ||
@@ -266,7 +266,7 @@ static void pl061_irq_unmask(struct irq_data *d) | |||
266 | static void pl061_irq_ack(struct irq_data *d) | 266 | static void pl061_irq_ack(struct irq_data *d) |
267 | { | 267 | { |
268 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 268 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
269 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 269 | struct pl061 *chip = gpiochip_get_data(gc); |
270 | u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR); | 270 | u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR); |
271 | 271 | ||
272 | spin_lock(&chip->lock); | 272 | spin_lock(&chip->lock); |
@@ -277,7 +277,7 @@ static void pl061_irq_ack(struct irq_data *d) | |||
277 | static int pl061_irq_set_wake(struct irq_data *d, unsigned int state) | 277 | static int pl061_irq_set_wake(struct irq_data *d, unsigned int state) |
278 | { | 278 | { |
279 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 279 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
280 | struct pl061_gpio *chip = gpiochip_get_data(gc); | 280 | struct pl061 *chip = gpiochip_get_data(gc); |
281 | 281 | ||
282 | return irq_set_irq_wake(chip->parent_irq, state); | 282 | return irq_set_irq_wake(chip->parent_irq, state); |
283 | } | 283 | } |
@@ -295,7 +295,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) | |||
295 | { | 295 | { |
296 | struct device *dev = &adev->dev; | 296 | struct device *dev = &adev->dev; |
297 | struct pl061_platform_data *pdata = dev_get_platdata(dev); | 297 | struct pl061_platform_data *pdata = dev_get_platdata(dev); |
298 | struct pl061_gpio *chip; | 298 | struct pl061 *chip; |
299 | int ret, irq, i, irq_base; | 299 | int ret, irq, i, irq_base; |
300 | 300 | ||
301 | chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); | 301 | chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); |
@@ -379,7 +379,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) | |||
379 | #ifdef CONFIG_PM | 379 | #ifdef CONFIG_PM |
380 | static int pl061_suspend(struct device *dev) | 380 | static int pl061_suspend(struct device *dev) |
381 | { | 381 | { |
382 | struct pl061_gpio *chip = dev_get_drvdata(dev); | 382 | struct pl061 *chip = dev_get_drvdata(dev); |
383 | int offset; | 383 | int offset; |
384 | 384 | ||
385 | chip->csave_regs.gpio_data = 0; | 385 | chip->csave_regs.gpio_data = 0; |
@@ -400,7 +400,7 @@ static int pl061_suspend(struct device *dev) | |||
400 | 400 | ||
401 | static int pl061_resume(struct device *dev) | 401 | static int pl061_resume(struct device *dev) |
402 | { | 402 | { |
403 | struct pl061_gpio *chip = dev_get_drvdata(dev); | 403 | struct pl061 *chip = dev_get_drvdata(dev); |
404 | int offset; | 404 | int offset; |
405 | 405 | ||
406 | for (offset = 0; offset < PL061_GPIO_NR; offset++) { | 406 | for (offset = 0; offset < PL061_GPIO_NR; offset++) { |