mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	gpio: stmpe: Use irqchip template
This makes the driver use the irqchip template to assign properties to the gpio_irq_chip instead of using the explicit calls to gpiochip_irqchip_add_nested() and gpiochip_set_nested_irqchip(). The irqchip is instead added while adding the gpiochip. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Alexandre TORGUE <alexandre.torgue@st.com> Link: https://lore.kernel.org/r/20200716100638.112451-1-linus.walleij@linaro.org
This commit is contained in:
		
							parent
							
								
									0fcfd9aa61
								
							
						
					
					
						commit
						9745079609
					
				
					 1 changed files with 11 additions and 13 deletions
				
			
		| 
						 | 
					@ -507,6 +507,8 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (irq > 0) {
 | 
						if (irq > 0) {
 | 
				
			||||||
 | 
							struct gpio_irq_chip *girq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 | 
							ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 | 
				
			||||||
				stmpe_gpio_irq, IRQF_ONESHOT,
 | 
									stmpe_gpio_irq, IRQF_ONESHOT,
 | 
				
			||||||
				"stmpe-gpio", stmpe_gpio);
 | 
									"stmpe-gpio", stmpe_gpio);
 | 
				
			||||||
| 
						 | 
					@ -514,20 +516,16 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 | 
				
			||||||
			dev_err(&pdev->dev, "unable to get irq: %d\n", ret);
 | 
								dev_err(&pdev->dev, "unable to get irq: %d\n", ret);
 | 
				
			||||||
			goto out_disable;
 | 
								goto out_disable;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		ret =  gpiochip_irqchip_add_nested(&stmpe_gpio->chip,
 | 
					 | 
				
			||||||
						   &stmpe_gpio_irq_chip,
 | 
					 | 
				
			||||||
						   0,
 | 
					 | 
				
			||||||
						   handle_simple_irq,
 | 
					 | 
				
			||||||
						   IRQ_TYPE_NONE);
 | 
					 | 
				
			||||||
		if (ret) {
 | 
					 | 
				
			||||||
			dev_err(&pdev->dev,
 | 
					 | 
				
			||||||
				"could not connect irqchip to gpiochip\n");
 | 
					 | 
				
			||||||
			goto out_disable;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		gpiochip_set_nested_irqchip(&stmpe_gpio->chip,
 | 
							girq = &stmpe_gpio->chip.irq;
 | 
				
			||||||
					    &stmpe_gpio_irq_chip,
 | 
							girq->chip = &stmpe_gpio_irq_chip;
 | 
				
			||||||
					    irq);
 | 
							/* This will let us handle the parent IRQ in the driver */
 | 
				
			||||||
 | 
							girq->parent_handler = NULL;
 | 
				
			||||||
 | 
							girq->num_parents = 0;
 | 
				
			||||||
 | 
							girq->parents = NULL;
 | 
				
			||||||
 | 
							girq->default_type = IRQ_TYPE_NONE;
 | 
				
			||||||
 | 
							girq->handler = handle_simple_irq;
 | 
				
			||||||
 | 
							girq->threaded = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	platform_set_drvdata(pdev, stmpe_gpio);
 | 
						platform_set_drvdata(pdev, stmpe_gpio);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue