From fc3d3369c6e1bfc9181d2d7ff8c452ef24e36e41 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 25 Jun 2021 09:45:57 +0200 Subject: staging: hi6421-spmi-pmic: use devm_request_threaded_irq() Use devm_request_threaded_irq() in order to simplify the driver. Suggested-by: Lee Jones Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/b47827c3466eeef3a7de6ac56b1fe93b5ff84e30.1624606660.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c index 626140cb96f2..a094b81c721e 100644 --- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c +++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c @@ -250,9 +250,11 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *pdev) ddata->irqs[i] = virq; } - ret = request_threaded_irq(ddata->irq, hi6421_spmi_irq_handler, NULL, - IRQF_TRIGGER_LOW | IRQF_SHARED | IRQF_NO_SUSPEND, - "pmic", ddata); + ret = devm_request_threaded_irq(dev, + ddata->irq, hi6421_spmi_irq_handler, + NULL, + IRQF_TRIGGER_LOW | IRQF_SHARED | IRQF_NO_SUSPEND, + "pmic", ddata); if (ret < 0) { dev_err(dev, "Failed to start IRQ handling thread: error %d\n", ret); @@ -270,13 +272,6 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *pdev) return ret; } -static void hi6421_spmi_pmic_remove(struct spmi_device *pdev) -{ - struct hi6421_spmi_pmic *ddata = dev_get_drvdata(&pdev->dev); - - free_irq(ddata->irq, ddata); -} - static const struct of_device_id pmic_spmi_id_table[] = { { .compatible = "hisilicon,hi6421-spmi" }, { } @@ -289,7 +284,6 @@ static struct spmi_driver hi6421_spmi_pmic_driver = { .of_match_table = pmic_spmi_id_table, }, .probe = hi6421_spmi_pmic_probe, - .remove = hi6421_spmi_pmic_remove, }; module_spmi_driver(hi6421_spmi_pmic_driver); -- cgit v1.2.3