* [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq
@ 2013-09-25 7:40 Wei Yongjun
2013-11-26 23:27 ` Brian Norris
2013-11-26 23:54 ` Brian Norris
0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2013-09-25 7:40 UTC (permalink / raw)
To: dwmw2, grant.likely, rob.herring, artem.bityutskiy, wfp5p,
shijie8, agust, gsi
Cc: yongjun_wei, linux-mtd
From: Wei Yongjun <yongjun_wei@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@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
@@ -784,7 +784,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
/* Detect NAND chips */
if (nand_scan(mtd, be32_to_cpup(chips_no))) {
dev_err(dev, "NAND Flash not found !\n");
- devm_free_irq(dev, prv->irq, mtd);
retval = -ENXIO;
goto error;
}
@@ -809,7 +808,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
default:
dev_err(dev, "Unsupported NAND flash!\n");
- devm_free_irq(dev, prv->irq, mtd);
retval = -ENXIO;
goto error;
}
@@ -820,7 +818,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
retval = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
if (retval) {
dev_err(dev, "Error adding MTD device!\n");
- devm_free_irq(dev, prv->irq, mtd);
goto error;
}
@@ -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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq
2013-09-25 7:40 [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq Wei Yongjun
@ 2013-11-26 23:27 ` Brian Norris
2013-11-26 23:54 ` Brian Norris
1 sibling, 0 replies; 4+ messages in thread
From: Brian Norris @ 2013-11-26 23:27 UTC (permalink / raw)
To: Wei Yongjun
Cc: artem.bityutskiy, gsi, rob.herring, yongjun_wei, wfp5p, linux-mtd,
grant.likely, agust, shijie8, dwmw2
On Wed, Sep 25, 2013 at 03:40:38PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@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@trendmicro.com.cn>
Pushed to l2-mtd.git. Thanks!
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq
2013-09-25 7:40 [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq Wei Yongjun
2013-11-26 23:27 ` Brian Norris
@ 2013-11-26 23:54 ` Brian Norris
2013-11-27 0:20 ` Brian Norris
1 sibling, 1 reply; 4+ messages in thread
From: Brian Norris @ 2013-11-26 23:54 UTC (permalink / raw)
To: Wei Yongjun
Cc: artem.bityutskiy, gsi, rob.herring, yongjun_wei, wfp5p, linux-mtd,
grant.likely, agust, shijie8, dwmw2
On Wed, Sep 25, 2013 at 03:40:38PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@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@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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq
2013-11-26 23:54 ` Brian Norris
@ 2013-11-27 0:20 ` Brian Norris
0 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2013-11-27 0:20 UTC (permalink / raw)
To: Wei Yongjun
Cc: artem.bityutskiy, gsi, rob.herring, yongjun_wei, wfp5p, linux-mtd,
grant.likely, agust, shijie8, dwmw2
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@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@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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-27 0:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25 7:40 [PATCH] mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq Wei Yongjun
2013-11-26 23:27 ` Brian Norris
2013-11-26 23:54 ` Brian Norris
2013-11-27 0:20 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox