mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq
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> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
Родитель
c23259627c
Коммит
afc62baf10
|
@ -786,7 +786,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
|
||||||
/* Detect NAND chips */
|
/* Detect NAND chips */
|
||||||
if (nand_scan(mtd, be32_to_cpup(chips_no))) {
|
if (nand_scan(mtd, be32_to_cpup(chips_no))) {
|
||||||
dev_err(dev, "NAND Flash not found !\n");
|
dev_err(dev, "NAND Flash not found !\n");
|
||||||
devm_free_irq(dev, prv->irq, mtd);
|
|
||||||
retval = -ENXIO;
|
retval = -ENXIO;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -811,7 +810,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dev_err(dev, "Unsupported NAND flash!\n");
|
dev_err(dev, "Unsupported NAND flash!\n");
|
||||||
devm_free_irq(dev, prv->irq, mtd);
|
|
||||||
retval = -ENXIO;
|
retval = -ENXIO;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -822,7 +820,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
|
||||||
retval = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
|
retval = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
dev_err(dev, "Error adding MTD device!\n");
|
dev_err(dev, "Error adding MTD device!\n");
|
||||||
devm_free_irq(dev, prv->irq, mtd);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,11 +833,8 @@ static int mpc5121_nfc_remove(struct platform_device *op)
|
||||||
{
|
{
|
||||||
struct device *dev = &op->dev;
|
struct device *dev = &op->dev;
|
||||||
struct mtd_info *mtd = dev_get_drvdata(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);
|
nand_release(mtd);
|
||||||
devm_free_irq(dev, prv->irq, mtd);
|
|
||||||
mpc5121_nfc_free(dev, mtd);
|
mpc5121_nfc_free(dev, mtd);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче