[PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq

Brian Norris computersforpeace at gmail.com
Tue Nov 26 19:20:03 EST 2013


On Tue, Nov 26, 2013 at 03:54:01PM -0800, Brian Norris wrote:
> On Wed, Sep 25, 2013 at 03:40:38PM +0800, Wei Yongjun wrote:
> > From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
> > 
> > The devm_request_irq function allocates irq that is released
> > when a driver detaches. Thus, there is no reason to explicitly
> > call devm_free_irq in probe or remove functions.
> > 
> > Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
> > ---
> >  drivers/mtd/nand/mpc5121_nfc.c | 4 ----
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
> > index 3c60a00..7df37f0 100644
> > --- a/drivers/mtd/nand/mpc5121_nfc.c
> > +++ b/drivers/mtd/nand/mpc5121_nfc.c
> > @@ -838,7 +835,6 @@ static int mpc5121_nfc_remove(struct platform_device *op)
> >  	struct mpc5121_nfc_prv *prv = chip->priv;
> >  
> >  	nand_release(mtd);
> > -	devm_free_irq(dev, prv->irq, mtd);
> >  	mpc5121_nfc_free(dev, mtd);
> >  
> >  	return 0;
> > 
> 
> Just noticed a new warning after this hunk:
> 
> drivers/mtd/nand/mpc5121_nfc.c:837:26: warning: unused variable 'prv' [-Wunused-variable]

...and one more:

drivers/mtd/nand/mpc5121_nfc.c:836:20: warning: unused variable 'chip' [-Wunused-variable]

diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 435f684..d744cf7 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -833,7 +833,6 @@ static int mpc5121_nfc_remove(struct platform_device *op)
 {
 	struct device *dev = &op->dev;
 	struct mtd_info *mtd = dev_get_drvdata(dev);
-	struct nand_chip *chip = mtd->priv;
 
 	nand_release(mtd);
 	mpc5121_nfc_free(dev, mtd);



More information about the linux-mtd mailing list