Lines Matching +full:rc +full:- +full:map +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0-or-later
51 hwirq = fls64(e) - 1; in opal_handle_events()
79 clear_bit(d->hwirq, &opal_event_irqchip.mask); in opal_event_mask()
84 set_bit(d->hwirq, &opal_event_irqchip.mask); in opal_event_unmask()
97 return -EINVAL; in opal_event_set_type()
104 .name = "OPAL EVT",
152 .map = opal_event_map,
178 int i, rc = 0; in opal_event_init() local
183 return -ENODEV; in opal_event_init()
193 dn = of_find_compatible_node(NULL, NULL, "ibm,opal-event"); in opal_event_init()
199 rc = -ENOMEM; in opal_event_init()
203 /* Look for new-style (standard) "interrupts" property */ in opal_event_init()
208 /* Get opal-interrupts property and names if present */ in opal_event_init()
209 rc = of_property_count_u32_elems(opal_node, "opal-interrupts"); in opal_event_init()
210 if (rc > 0) in opal_event_init()
211 opal_irq_count = rc; in opal_event_init()
225 rc = -ENOMEM; in opal_event_init()
231 /* Old style "opal-interrupts" property */ in opal_event_init()
234 const char *name = NULL; in opal_event_init() local
238 rc = of_property_read_u32_index(opal_node, "opal-interrupts", in opal_event_init()
240 if (WARN_ON(rc < 0)) { in opal_event_init()
244 of_property_read_string_index(opal_node, "opal-interrupts-names", in opal_event_init()
245 i, &name); in opal_event_init()
248 pr_warn("Failed to map OPAL irq 0x%x\n", hw_irq); in opal_event_init()
251 r->start = r->end = virq; in opal_event_init()
252 r->flags = IORESOURCE_IRQ | IRQ_TYPE_LEVEL_LOW; in opal_event_init()
253 r->name = name; in opal_event_init()
257 rc = of_irq_to_resource_table(opal_node, opal_irqs, opal_irq_count); in opal_event_init()
258 if (WARN_ON(rc < 0)) { in opal_event_init()
263 if (WARN_ON(rc < opal_irq_count)) in opal_event_init()
264 opal_irq_count = rc; in opal_event_init()
270 const char *name; in opal_event_init() local
272 /* Prefix name */ in opal_event_init()
273 if (r->name && strlen(r->name)) in opal_event_init()
274 name = kasprintf(GFP_KERNEL, "opal-%s", r->name); in opal_event_init()
276 name = kasprintf(GFP_KERNEL, "opal"); in opal_event_init()
278 if (!name) in opal_event_init()
281 rc = request_irq(r->start, opal_interrupt, r->flags & IRQD_TRIGGER_MASK, in opal_event_init()
282 name, NULL); in opal_event_init()
283 if (rc) { in opal_event_init()
284 pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start); in opal_event_init()
285 kfree(name); in opal_event_init()
289 rc = 0; in opal_event_init()
292 return rc; in opal_event_init()
297 * opal_event_request(unsigned int opal_event_nr) - Request an event