Skip to content

Commit 3344265

Browse files
author
Marc Zyngier
committed
irqchip/ts4800: Switch to dynamic chip name output
Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20220209162607.1118325-7-maz@kernel.org
1 parent 421f162 commit 3344265

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

drivers/irqchip/irq-ts4800.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
#include <linux/of_address.h>
2020
#include <linux/of_irq.h>
2121
#include <linux/platform_device.h>
22+
#include <linux/seq_file.h>
2223

2324
#define IRQ_MASK 0x4
2425
#define IRQ_STATUS 0x8
2526

2627
struct ts4800_irq_data {
2728
void __iomem *base;
29+
struct platform_device *pdev;
2830
struct irq_domain *domain;
29-
struct irq_chip irq_chip;
3031
};
3132

3233
static void ts4800_irq_mask(struct irq_data *d)
@@ -47,12 +48,25 @@ static void ts4800_irq_unmask(struct irq_data *d)
4748
writew(reg & ~mask, data->base + IRQ_MASK);
4849
}
4950

51+
static void ts4800_irq_print_chip(struct irq_data *d, struct seq_file *p)
52+
{
53+
struct ts4800_irq_data *data = irq_data_get_irq_chip_data(d);
54+
55+
seq_printf(p, "%s", dev_name(&data->pdev->dev));
56+
}
57+
58+
static const struct irq_chip ts4800_chip = {
59+
.irq_mask = ts4800_irq_mask,
60+
.irq_unmask = ts4800_irq_unmask,
61+
.irq_print_chip = ts4800_irq_print_chip,
62+
};
63+
5064
static int ts4800_irqdomain_map(struct irq_domain *d, unsigned int irq,
5165
irq_hw_number_t hwirq)
5266
{
5367
struct ts4800_irq_data *data = d->host_data;
5468

55-
irq_set_chip_and_handler(irq, &data->irq_chip, handle_simple_irq);
69+
irq_set_chip_and_handler(irq, &ts4800_chip, handle_simple_irq);
5670
irq_set_chip_data(irq, data);
5771
irq_set_noprobe(irq);
5872

@@ -92,13 +106,13 @@ static int ts4800_ic_probe(struct platform_device *pdev)
92106
{
93107
struct device_node *node = pdev->dev.of_node;
94108
struct ts4800_irq_data *data;
95-
struct irq_chip *irq_chip;
96109
int parent_irq;
97110

98111
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
99112
if (!data)
100113
return -ENOMEM;
101114

115+
data->pdev = pdev;
102116
data->base = devm_platform_ioremap_resource(pdev, 0);
103117
if (IS_ERR(data->base))
104118
return PTR_ERR(data->base);
@@ -111,11 +125,6 @@ static int ts4800_ic_probe(struct platform_device *pdev)
111125
return -EINVAL;
112126
}
113127

114-
irq_chip = &data->irq_chip;
115-
irq_chip->name = dev_name(&pdev->dev);
116-
irq_chip->irq_mask = ts4800_irq_mask;
117-
irq_chip->irq_unmask = ts4800_irq_unmask;
118-
119128
data->domain = irq_domain_add_linear(node, 8, &ts4800_ic_ops, data);
120129
if (!data->domain) {
121130
dev_err(&pdev->dev, "cannot add IRQ domain\n");

0 commit comments

Comments
 (0)