On Fri, Jul 17, 2020 at 09:11:52PM +0200, Heiko Stübner wrote:
> Am Freitag, 17. Juli 2020, 18:11:58 CEST schrieb Dejin Zheng:
> > Use devm_platform_request_irq() to simplify code, and it contains
> > platform_get_irq() and devm_request_irq().
> > 
> > Cc: Michal Simek <michal.si...@xilinx.com>
> > Cc: Wolfram Sang <w...@the-dreams.de>
> > Signed-off-by: Dejin Zheng <zhengdej...@gmail.com>
> > Acked-by: Linus Walleij <linus.wall...@linaro.org>
> > Acked-by: Michal Simek <michal.si...@xilinx.com>
> 
> 
> Rockchip part (i2c-rk3x):
> Reviewed-by: Heiko Stuebner <he...@sntech.de>
>
Heiko, Thanks a lot.

BR,
Dejin
> > diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> > index 8e3cc85d1921..1f0ac69c5774 100644
> > --- a/drivers/i2c/busses/i2c-rk3x.c
> > +++ b/drivers/i2c/busses/i2c-rk3x.c
> > @@ -1227,7 +1227,6 @@ static int rk3x_i2c_probe(struct platform_device 
> > *pdev)
> >     int ret = 0;
> >     int bus_nr;
> >     u32 value;
> > -   int irq;
> >     unsigned long clk_rate;
> >  
> >     i2c = devm_kzalloc(&pdev->dev, sizeof(struct rk3x_i2c), GFP_KERNEL);
> > @@ -1289,17 +1288,10 @@ static int rk3x_i2c_probe(struct platform_device 
> > *pdev)
> >             }
> >     }
> >  
> > -   /* IRQ setup */
> > -   irq = platform_get_irq(pdev, 0);
> > -   if (irq < 0)
> > -           return irq;
> > -
> > -   ret = devm_request_irq(&pdev->dev, irq, rk3x_i2c_irq,
> > -                          0, dev_name(&pdev->dev), i2c);
> > -   if (ret < 0) {
> > -           dev_err(&pdev->dev, "cannot request IRQ\n");
> > +   ret = devm_platform_request_irq(pdev, 0, NULL, rk3x_i2c_irq,
> > +                                   0, dev_name(&pdev->dev), i2c);
> > +   if (ret < 0)
> >             return ret;
> > -   }
> >  
> >     platform_set_drvdata(pdev, i2c);
> >  
> 
> 
> 
> 

Reply via email to