Revert "genirq: Allow irq_chip registration functions to take a const irq_chip"

This reverts commit f19bf41e73 which is
commit 393e1280f765661cf39785e967676a4e57324126 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: If02b4d096b62cb90fc84ec181c3b7168c1c30267
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-08-30 10:04:57 +00:00
parent e11b864e72
commit d131a10522
2 changed files with 9 additions and 7 deletions

View file

@ -683,11 +683,10 @@ extern struct irq_chip no_irq_chip;
extern struct irq_chip dummy_irq_chip; extern struct irq_chip dummy_irq_chip;
extern void extern void
irq_set_chip_and_handler_name(unsigned int irq, const struct irq_chip *chip, irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
irq_flow_handler_t handle, const char *name); irq_flow_handler_t handle, const char *name);
static inline void irq_set_chip_and_handler(unsigned int irq, static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *chip,
const struct irq_chip *chip,
irq_flow_handler_t handle) irq_flow_handler_t handle)
{ {
irq_set_chip_and_handler_name(irq, chip, handle, NULL); irq_set_chip_and_handler_name(irq, chip, handle, NULL);
@ -777,7 +776,7 @@ static inline void irq_set_percpu_devid_flags(unsigned int irq)
} }
/* Set/get chip/data for an IRQ: */ /* Set/get chip/data for an IRQ: */
extern int irq_set_chip(unsigned int irq, const struct irq_chip *chip); extern int irq_set_chip(unsigned int irq, struct irq_chip *chip);
extern int irq_set_handler_data(unsigned int irq, void *data); extern int irq_set_handler_data(unsigned int irq, void *data);
extern int irq_set_chip_data(unsigned int irq, void *data); extern int irq_set_chip_data(unsigned int irq, void *data);
extern int irq_set_irq_type(unsigned int irq, unsigned int type); extern int irq_set_irq_type(unsigned int irq, unsigned int type);

View file

@ -39,7 +39,7 @@ struct irqaction chained_action = {
* @irq: irq number * @irq: irq number
* @chip: pointer to irq chip description structure * @chip: pointer to irq chip description structure
*/ */
int irq_set_chip(unsigned int irq, const struct irq_chip *chip) int irq_set_chip(unsigned int irq, struct irq_chip *chip)
{ {
unsigned long flags; unsigned long flags;
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0); struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
@ -47,7 +47,10 @@ int irq_set_chip(unsigned int irq, const struct irq_chip *chip)
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
desc->irq_data.chip = (struct irq_chip *)(chip ?: &no_irq_chip); if (!chip)
chip = &no_irq_chip;
desc->irq_data.chip = chip;
irq_put_desc_unlock(desc, flags); irq_put_desc_unlock(desc, flags);
/* /*
* For !CONFIG_SPARSE_IRQ make the irq show up in * For !CONFIG_SPARSE_IRQ make the irq show up in
@ -1098,7 +1101,7 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
EXPORT_SYMBOL_GPL(irq_set_chained_handler_and_data); EXPORT_SYMBOL_GPL(irq_set_chained_handler_and_data);
void void
irq_set_chip_and_handler_name(unsigned int irq, const struct irq_chip *chip, irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
irq_flow_handler_t handle, const char *name) irq_flow_handler_t handle, const char *name)
{ {
irq_set_chip(irq, chip); irq_set_chip(irq, chip);