Message ID | 20220913164639.403025-2-sergio.paracuellos@gmail.com |
---|---|
State | Accepted |
Commit | f7d619e9ab851eb89ab50c9265504ed732d5bee2 |
Headers | show |
Series | [v2] gpio: mt7621: Switch to use platform_get_irq() function | expand |
On Tue, Sep 13, 2022 at 6:46 PM Sergio Paracuellos <sergio.paracuellos@gmail.com> wrote: > > Mt7621 SoC GPIO driver is a platform driver so we can directly use > 'platform_get_irq' instead of 'irq_of_parse_and_map'. > > Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> > --- > Change in v2: > - Make independent PATCH since this must go to next branch. > > drivers/gpio/gpio-mt7621.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c > index f163f5ca857b..93facbebb80e 100644 > --- a/drivers/gpio/gpio-mt7621.c > +++ b/drivers/gpio/gpio-mt7621.c > @@ -9,7 +9,6 @@ > #include <linux/interrupt.h> > #include <linux/io.h> > #include <linux/module.h> > -#include <linux/of_irq.h> > #include <linux/platform_device.h> > #include <linux/spinlock.h> > > @@ -299,7 +298,6 @@ static int > mediatek_gpio_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > - struct device_node *np = dev->of_node; > struct mtk *mtk; > int i; > int ret; > @@ -312,7 +310,10 @@ mediatek_gpio_probe(struct platform_device *pdev) > if (IS_ERR(mtk->base)) > return PTR_ERR(mtk->base); > > - mtk->gpio_irq = irq_of_parse_and_map(np, 0); > + mtk->gpio_irq = platform_get_irq(pdev, 0); > + if (mtk->gpio_irq < 0) > + return mtk->gpio_irq; > + > mtk->dev = dev; > platform_set_drvdata(pdev, mtk); > > -- > 2.25.1 > Applied, thanks! Bart
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c index f163f5ca857b..93facbebb80e 100644 --- a/drivers/gpio/gpio-mt7621.c +++ b/drivers/gpio/gpio-mt7621.c @@ -9,7 +9,6 @@ #include <linux/interrupt.h> #include <linux/io.h> #include <linux/module.h> -#include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/spinlock.h> @@ -299,7 +298,6 @@ static int mediatek_gpio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; struct mtk *mtk; int i; int ret; @@ -312,7 +310,10 @@ mediatek_gpio_probe(struct platform_device *pdev) if (IS_ERR(mtk->base)) return PTR_ERR(mtk->base); - mtk->gpio_irq = irq_of_parse_and_map(np, 0); + mtk->gpio_irq = platform_get_irq(pdev, 0); + if (mtk->gpio_irq < 0) + return mtk->gpio_irq; + mtk->dev = dev; platform_set_drvdata(pdev, mtk);