Skip to content

Commit 79b16d0

Browse files
Marc Zyngiergregkh
authored andcommitted
pinctrl: npcm: Fix broken references to chip->parent_device
[ Upstream commit f7e53e2 ] The npcm driver has a bunch of references to the irq_chip parent_device field, but never sets it. Fix it by fishing that reference from somewhere else, but it is obvious that these debug statements were never used. Also remove an unused field in a local data structure. Signed-off-by: Marc Zyngier <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 9d1d8e5 commit 79b16d0

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ struct npcm7xx_gpio {
7878
struct gpio_chip gc;
7979
int irqbase;
8080
int irq;
81-
void *priv;
8281
struct irq_chip irq_chip;
8382
u32 pinctrl_id;
8483
int (*direction_input)(struct gpio_chip *chip, unsigned offset);
@@ -226,7 +225,7 @@ static void npcmgpio_irq_handler(struct irq_desc *desc)
226225
chained_irq_enter(chip, desc);
227226
sts = ioread32(bank->base + NPCM7XX_GP_N_EVST);
228227
en = ioread32(bank->base + NPCM7XX_GP_N_EVEN);
229-
dev_dbg(chip->parent_device, "==> got irq sts %.8x %.8x\n", sts,
228+
dev_dbg(bank->gc.parent, "==> got irq sts %.8x %.8x\n", sts,
230229
en);
231230

232231
sts &= en;
@@ -241,33 +240,33 @@ static int npcmgpio_set_irq_type(struct irq_data *d, unsigned int type)
241240
gpiochip_get_data(irq_data_get_irq_chip_data(d));
242241
unsigned int gpio = BIT(d->hwirq);
243242

244-
dev_dbg(d->chip->parent_device, "setirqtype: %u.%u = %u\n", gpio,
243+
dev_dbg(bank->gc.parent, "setirqtype: %u.%u = %u\n", gpio,
245244
d->irq, type);
246245
switch (type) {
247246
case IRQ_TYPE_EDGE_RISING:
248-
dev_dbg(d->chip->parent_device, "edge.rising\n");
247+
dev_dbg(bank->gc.parent, "edge.rising\n");
249248
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_EVBE, gpio);
250249
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
251250
break;
252251
case IRQ_TYPE_EDGE_FALLING:
253-
dev_dbg(d->chip->parent_device, "edge.falling\n");
252+
dev_dbg(bank->gc.parent, "edge.falling\n");
254253
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_EVBE, gpio);
255254
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
256255
break;
257256
case IRQ_TYPE_EDGE_BOTH:
258-
dev_dbg(d->chip->parent_device, "edge.both\n");
257+
dev_dbg(bank->gc.parent, "edge.both\n");
259258
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_EVBE, gpio);
260259
break;
261260
case IRQ_TYPE_LEVEL_LOW:
262-
dev_dbg(d->chip->parent_device, "level.low\n");
261+
dev_dbg(bank->gc.parent, "level.low\n");
263262
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
264263
break;
265264
case IRQ_TYPE_LEVEL_HIGH:
266-
dev_dbg(d->chip->parent_device, "level.high\n");
265+
dev_dbg(bank->gc.parent, "level.high\n");
267266
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
268267
break;
269268
default:
270-
dev_dbg(d->chip->parent_device, "invalid irq type\n");
269+
dev_dbg(bank->gc.parent, "invalid irq type\n");
271270
return -EINVAL;
272271
}
273272

@@ -289,7 +288,7 @@ static void npcmgpio_irq_ack(struct irq_data *d)
289288
gpiochip_get_data(irq_data_get_irq_chip_data(d));
290289
unsigned int gpio = d->hwirq;
291290

292-
dev_dbg(d->chip->parent_device, "irq_ack: %u.%u\n", gpio, d->irq);
291+
dev_dbg(bank->gc.parent, "irq_ack: %u.%u\n", gpio, d->irq);
293292
iowrite32(BIT(gpio), bank->base + NPCM7XX_GP_N_EVST);
294293
}
295294

@@ -301,7 +300,7 @@ static void npcmgpio_irq_mask(struct irq_data *d)
301300
unsigned int gpio = d->hwirq;
302301

303302
/* Clear events */
304-
dev_dbg(d->chip->parent_device, "irq_mask: %u.%u\n", gpio, d->irq);
303+
dev_dbg(bank->gc.parent, "irq_mask: %u.%u\n", gpio, d->irq);
305304
iowrite32(BIT(gpio), bank->base + NPCM7XX_GP_N_EVENC);
306305
}
307306

@@ -313,7 +312,7 @@ static void npcmgpio_irq_unmask(struct irq_data *d)
313312
unsigned int gpio = d->hwirq;
314313

315314
/* Enable events */
316-
dev_dbg(d->chip->parent_device, "irq_unmask: %u.%u\n", gpio, d->irq);
315+
dev_dbg(bank->gc.parent, "irq_unmask: %u.%u\n", gpio, d->irq);
317316
iowrite32(BIT(gpio), bank->base + NPCM7XX_GP_N_EVENS);
318317
}
319318

@@ -323,7 +322,7 @@ static unsigned int npcmgpio_irq_startup(struct irq_data *d)
323322
unsigned int gpio = d->hwirq;
324323

325324
/* active-high, input, clear interrupt, enable interrupt */
326-
dev_dbg(d->chip->parent_device, "startup: %u.%u\n", gpio, d->irq);
325+
dev_dbg(gc->parent, "startup: %u.%u\n", gpio, d->irq);
327326
npcmgpio_direction_input(gc, gpio);
328327
npcmgpio_irq_ack(d);
329328
npcmgpio_irq_unmask(d);

0 commit comments

Comments
 (0)