]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'regmap/topic/doc' and 'regmap/topic/irq' into regmap...
authorMark Brown <broonie@kernel.org>
Wed, 10 Feb 2016 07:09:17 +0000 (07:09 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 10 Feb 2016 07:09:17 +0000 (07:09 +0000)
drivers/base/regmap/regmap-irq.c
include/linux/regmap.h

index 9b0d202414d065bf6e03a6f39bb33c9925dee4db..7e1e9e86c70b9833ead6d6aea499ee8b0282bc40 100644 (file)
@@ -655,13 +655,34 @@ EXPORT_SYMBOL_GPL(regmap_add_irq_chip);
  *
  * @irq: Primary IRQ for the device
  * @d:   regmap_irq_chip_data allocated by regmap_add_irq_chip()
+ *
+ * This function also dispose all mapped irq on chip.
  */
 void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)
 {
+       unsigned int virq;
+       int hwirq;
+
        if (!d)
                return;
 
        free_irq(irq, d);
+
+       /* Dispose all virtual irq from irq domain before removing it */
+       for (hwirq = 0; hwirq < d->chip->num_irqs; hwirq++) {
+               /* Ignore hwirq if holes in the IRQ list */
+               if (!d->chip->irqs[hwirq].mask)
+                       continue;
+
+               /*
+                * Find the virtual irq of hwirq on chip and if it is
+                * there then dispose it
+                */
+               virq = irq_find_mapping(d->domain, hwirq);
+               if (virq)
+                       irq_dispose_mapping(virq);
+       }
+
        irq_domain_remove(d->domain);
        kfree(d->type_buf);
        kfree(d->type_buf_def);
index 18394343f4891a42dc986e4a17e9c9ebb0b747ee..27aaac9027c4545d0e69a22b49128b380218cbe3 100644 (file)
@@ -162,7 +162,7 @@ typedef void (*regmap_unlock)(void *);
  *               This field is a duplicate of a similar file in
  *               'struct regmap_bus' and serves exact same purpose.
  *                Use it only for "no-bus" cases.
- * @max_register: Optional, specifies the maximum valid register index.
+ * @max_register: Optional, specifies the maximum valid register address.
  * @wr_table:     Optional, points to a struct regmap_access_table specifying
  *                valid ranges for write access.
  * @rd_table:     As above, for read access.