]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: irq: add devm apis for regmap_{add,del}_irq_chip
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 10 Feb 2016 08:59:50 +0000 (14:29 +0530)
committerMark Brown <broonie@kernel.org>
Sat, 5 Mar 2016 05:32:27 +0000 (14:32 +0900)
commit4b415472e94d8950fe5fc7c85cc14c1a3afe1f54
treee657e3858d6bb9d621a7828ad3a1e3e886e24757
parent5367e65a538f2d59834d845f582bc1f1ae9599b8
regmap: irq: add devm apis for regmap_{add,del}_irq_chip

Add device managed APIs for regmap_add_irq_chip() and
regmap_del_irq_chip() so that it can be managed by
device framework for freeing it.

This helps on following:
1. Maintaining the sequence of resource allocation and deallocation
regmap_add_irq_chip(&d);
devm_requested_threaded_irq(virq)

On free path:
regmap_del_irq_chip(d);
and then removing the irq registration.

On this case, regmap irq is deleted before the irq is free.
This force to use normal irq registration.

By using devm apis, the sequence can be maintain properly:
devm_regmap_add_irq_chip(&d);
devm_requested_threaded_irq(virq);

and resource deallocation will be done in reverse order
by device framework.

2. No need to delete the regmap_irq_chip in error path or remove
   callback and hence there is less code on this path.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-irq.c
include/linux/regmap.h