spmi/pmic_arb: Consolidate chained IRQ handler install/remove

Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc->lock. Replace the two calls
with one.

Search and conversion was done with coccinelle.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Link: http://lkml.kernel.org/r/20150713151750.831790045@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Thomas Gleixner 2015-07-13 20:52:24 +00:00 committed by Ingo Molnar
parent c497615c0c
commit fb68ba6d0b

View File

@ -928,8 +928,7 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
goto err_put_ctrl; goto err_put_ctrl;
} }
irq_set_handler_data(pa->irq, pa); irq_set_chained_handler_and_data(pa->irq, pmic_arb_chained_irq, pa);
irq_set_chained_handler(pa->irq, pmic_arb_chained_irq);
err = spmi_controller_add(ctrl); err = spmi_controller_add(ctrl);
if (err) if (err)
@ -938,8 +937,7 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
return 0; return 0;
err_domain_remove: err_domain_remove:
irq_set_chained_handler(pa->irq, NULL); irq_set_chained_handler_and_data(pa->irq, NULL, NULL);
irq_set_handler_data(pa->irq, NULL);
irq_domain_remove(pa->domain); irq_domain_remove(pa->domain);
err_put_ctrl: err_put_ctrl:
spmi_controller_put(ctrl); spmi_controller_put(ctrl);
@ -951,8 +949,7 @@ static int spmi_pmic_arb_remove(struct platform_device *pdev)
struct spmi_controller *ctrl = platform_get_drvdata(pdev); struct spmi_controller *ctrl = platform_get_drvdata(pdev);
struct spmi_pmic_arb_dev *pa = spmi_controller_get_drvdata(ctrl); struct spmi_pmic_arb_dev *pa = spmi_controller_get_drvdata(ctrl);
spmi_controller_remove(ctrl); spmi_controller_remove(ctrl);
irq_set_chained_handler(pa->irq, NULL); irq_set_chained_handler_and_data(pa->irq, NULL, NULL);
irq_set_handler_data(pa->irq, NULL);
irq_domain_remove(pa->domain); irq_domain_remove(pa->domain);
spmi_controller_put(ctrl); spmi_controller_put(ctrl);
return 0; return 0;