aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-em.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-em.c')
-rw-r--r--drivers/gpio/gpio-em.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index ec48ed512628..efb4c2d0d132 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -85,22 +85,16 @@ static inline void em_gio_write(struct em_gio_priv *p, int offs,
85 iowrite32(value, p->base1 + (offs - GIO_IDT0)); 85 iowrite32(value, p->base1 + (offs - GIO_IDT0));
86} 86}
87 87
88static inline struct em_gio_priv *irq_to_priv(struct irq_data *d)
89{
90 struct irq_chip *chip = irq_data_get_irq_chip(d);
91 return container_of(chip, struct em_gio_priv, irq_chip);
92}
93
94static void em_gio_irq_disable(struct irq_data *d) 88static void em_gio_irq_disable(struct irq_data *d)
95{ 89{
96 struct em_gio_priv *p = irq_to_priv(d); 90 struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
97 91
98 em_gio_write(p, GIO_IDS, BIT(irqd_to_hwirq(d))); 92 em_gio_write(p, GIO_IDS, BIT(irqd_to_hwirq(d)));
99} 93}
100 94
101static void em_gio_irq_enable(struct irq_data *d) 95static void em_gio_irq_enable(struct irq_data *d)
102{ 96{
103 struct em_gio_priv *p = irq_to_priv(d); 97 struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
104 98
105 em_gio_write(p, GIO_IEN, BIT(irqd_to_hwirq(d))); 99 em_gio_write(p, GIO_IEN, BIT(irqd_to_hwirq(d)));
106} 100}
@@ -118,7 +112,7 @@ static unsigned char em_gio_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
118static int em_gio_irq_set_type(struct irq_data *d, unsigned int type) 112static int em_gio_irq_set_type(struct irq_data *d, unsigned int type)
119{ 113{
120 unsigned char value = em_gio_sense_table[type & IRQ_TYPE_SENSE_MASK]; 114 unsigned char value = em_gio_sense_table[type & IRQ_TYPE_SENSE_MASK];
121 struct em_gio_priv *p = irq_to_priv(d); 115 struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
122 unsigned int reg, offset, shift; 116 unsigned int reg, offset, shift;
123 unsigned long flags; 117 unsigned long flags;
124 unsigned long tmp; 118 unsigned long tmp;