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

Brian Norris computersforpeace at gmail.com
Tue Nov 26 18:54:01 EST 2013


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]

I'm squashing in the following diff and re-pushing to l2-mtd.git (no
action is required from you).

Thanks,
Brian

diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 5865995..435f684 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -834,7 +834,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;
-	struct mpc5121_nfc_prv *prv = chip->priv;
 
 	nand_release(mtd);
 	mpc5121_nfc_free(dev, mtd);



More information about the linux-mtd mailing list