static int phyirq_to_virq(struct wcd9xxx_core_resource *wcd9xxx_res, int offset) { struct wcd9xxx_irq_drv_data *data; data = wcd9xxx_get_irq_drv_d(wcd9xxx_res); if (!data) { pr_warn("%s: not registered to interrupt controller\n", __func__); return -EINVAL; } return irq_linear_revmap(data->domain, offset); }
static unsigned int wcd9xxx_irq_get_upstream_irq(struct wcd9xxx *wcd9xxx) { struct wcd9xxx_irq_drv_data *data; /* Hold parent's of node */ if (!of_node_get(of_irq_find_parent(wcd9xxx->dev->of_node))) return -EINVAL; data = wcd9xxx_get_irq_drv_d(wcd9xxx); if (!data) { pr_err("%s: interrupt controller is not registerd\n", __func__); return 0; } rmb(); return data->irq; }