@@ -29,6 +29,7 @@ struct fsl_gpio_soc_data {
2929
3030struct vf610_gpio_port {
3131 struct gpio_chip gc ;
32+ struct irq_chip ic ;
3233 void __iomem * base ;
3334 void __iomem * gpio_base ;
3435 const struct fsl_gpio_soc_data * sdata ;
@@ -60,8 +61,6 @@ struct vf610_gpio_port {
6061#define PORT_INT_EITHER_EDGE 0xb
6162#define PORT_INT_LOGIC_ONE 0xc
6263
63- static struct irq_chip vf610_gpio_irq_chip ;
64-
6564static const struct fsl_gpio_soc_data imx_data = {
6665 .have_paddr = true,
6766};
@@ -237,22 +236,14 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable)
237236 return 0 ;
238237}
239238
240- static struct irq_chip vf610_gpio_irq_chip = {
241- .name = "gpio-vf610" ,
242- .irq_ack = vf610_gpio_irq_ack ,
243- .irq_mask = vf610_gpio_irq_mask ,
244- .irq_unmask = vf610_gpio_irq_unmask ,
245- .irq_set_type = vf610_gpio_irq_set_type ,
246- .irq_set_wake = vf610_gpio_irq_set_wake ,
247- };
248-
249239static int vf610_gpio_probe (struct platform_device * pdev )
250240{
251241 struct device * dev = & pdev -> dev ;
252242 struct device_node * np = dev -> of_node ;
253243 struct vf610_gpio_port * port ;
254244 struct resource * iores ;
255245 struct gpio_chip * gc ;
246+ struct irq_chip * ic ;
256247 int i ;
257248 int ret ;
258249
@@ -316,6 +307,14 @@ static int vf610_gpio_probe(struct platform_device *pdev)
316307 gc -> direction_output = vf610_gpio_direction_output ;
317308 gc -> set = vf610_gpio_set ;
318309
310+ ic = & port -> ic ;
311+ ic -> name = "gpio-vf610" ;
312+ ic -> irq_ack = vf610_gpio_irq_ack ;
313+ ic -> irq_mask = vf610_gpio_irq_mask ;
314+ ic -> irq_unmask = vf610_gpio_irq_unmask ;
315+ ic -> irq_set_type = vf610_gpio_irq_set_type ;
316+ ic -> irq_set_wake = vf610_gpio_irq_set_wake ;
317+
319318 ret = gpiochip_add_data (gc , port );
320319 if (ret < 0 )
321320 return ret ;
@@ -327,14 +326,13 @@ static int vf610_gpio_probe(struct platform_device *pdev)
327326 /* Clear the interrupt status register for all GPIO's */
328327 vf610_gpio_writel (~0 , port -> base + PORT_ISFR );
329328
330- ret = gpiochip_irqchip_add (gc , & vf610_gpio_irq_chip , 0 ,
331- handle_edge_irq , IRQ_TYPE_NONE );
329+ ret = gpiochip_irqchip_add (gc , ic , 0 , handle_edge_irq , IRQ_TYPE_NONE );
332330 if (ret ) {
333331 dev_err (dev , "failed to add irqchip\n" );
334332 gpiochip_remove (gc );
335333 return ret ;
336334 }
337- gpiochip_set_chained_irqchip (gc , & vf610_gpio_irq_chip , port -> irq ,
335+ gpiochip_set_chained_irqchip (gc , ic , port -> irq ,
338336 vf610_gpio_irq_handler );
339337
340338 return 0 ;
0 commit comments