[PATCH 09/10] gpio: omap: Switch to dynamic chip name output

From: Marc Zyngier
Date: Wed Feb 09 2022 - 11:27:07 EST


Instead of overloading the name field, use the relevant callback to
output the device name. Take this opportunity to fix the trailing
commas that really should be semi-colons.

Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
---
drivers/gpio/gpio-omap.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 80ddc43fd875..f2f874f0bf95 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -22,6 +22,7 @@
#include <linux/pm.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/seq_file.h>
#include <linux/gpio/driver.h>
#include <linux/bitops.h>
#include <linux/platform_data/gpio-omap.h>
@@ -708,6 +709,13 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
raw_spin_unlock_irqrestore(&bank->lock, flags);
}

+static void omap_gpio_irq_print_chip(struct irq_data *d, struct seq_file *p)
+{
+ struct gpio_bank *bank = omap_irq_data_get_bank(d);
+
+ seq_printf(p, dev_name(bank->chip.parent));
+}
+
/*---------------------------------------------------------------------*/

static int omap_mpuio_suspend_noirq(struct device *dev)
@@ -1393,16 +1401,16 @@ static int omap_gpio_probe(struct platform_device *pdev)
if (!irqc)
return -ENOMEM;

- irqc->irq_startup = omap_gpio_irq_startup,
- irqc->irq_shutdown = omap_gpio_irq_shutdown,
- irqc->irq_ack = dummy_irq_chip.irq_ack,
- irqc->irq_mask = omap_gpio_mask_irq,
- irqc->irq_unmask = omap_gpio_unmask_irq,
- irqc->irq_set_type = omap_gpio_irq_type,
- irqc->irq_set_wake = omap_gpio_wake_enable,
- irqc->irq_bus_lock = omap_gpio_irq_bus_lock,
- irqc->irq_bus_sync_unlock = gpio_irq_bus_sync_unlock,
- irqc->name = dev_name(&pdev->dev);
+ irqc->irq_startup = omap_gpio_irq_startup;
+ irqc->irq_shutdown = omap_gpio_irq_shutdown;
+ irqc->irq_ack = dummy_irq_chip.irq_ack;
+ irqc->irq_mask = omap_gpio_mask_irq;
+ irqc->irq_unmask = omap_gpio_unmask_irq;
+ irqc->irq_set_type = omap_gpio_irq_type;
+ irqc->irq_set_wake = omap_gpio_wake_enable;
+ irqc->irq_bus_lock = omap_gpio_irq_bus_lock;
+ irqc->irq_bus_sync_unlock = gpio_irq_bus_sync_unlock;
+ irqc->irq_print_chip = omap_gpio_irq_print_chip;
irqc->flags = IRQCHIP_MASK_ON_SUSPEND;

bank->irq = platform_get_irq(pdev, 0);
--
2.30.2