irq: Tidy up of-platdata irq support
This function is available but not exported. More generally it does not really work as intended. Reimplement it and add a sandbox test too. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -64,8 +64,8 @@ int irq_read_and_clear(struct irq *irq)
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(OF_PLATDATA)
|
||||
int irq_get_by_driver_info(struct udevice *dev,
|
||||
struct phandle_1_arg *cells, struct irq *irq)
|
||||
int irq_get_by_phandle(struct udevice *dev, const struct phandle_2_arg *cells,
|
||||
struct irq *irq)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -74,6 +74,12 @@ int irq_get_by_driver_info(struct udevice *dev,
|
||||
return ret;
|
||||
irq->id = cells->arg[0];
|
||||
|
||||
/*
|
||||
* Note: we could call irq_of_xlate_default() here to do this properly.
|
||||
* For now, this is good enough for existing cases.
|
||||
*/
|
||||
irq->flags = cells->arg[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user