/arch/powerpc/platforms/pseries/event_sources.c

http://github.com/mirrors/linux · C · 30 lines · 21 code · 5 blank · 4 comment · 4 complexity · d968f6cd2bb519dd12278c0ec33ef1f9 MD5 · raw file

  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2001 Dave Engebretsen IBM Corporation
  4. */
  5. #include <linux/interrupt.h>
  6. #include <linux/of_irq.h>
  7. #include "pseries.h"
  8. void request_event_sources_irqs(struct device_node *np,
  9. irq_handler_t handler,
  10. const char *name)
  11. {
  12. int i, virq, rc;
  13. for (i = 0; i < 16; i++) {
  14. virq = of_irq_get(np, i);
  15. if (virq < 0)
  16. return;
  17. if (WARN(!virq, "event-sources: Unable to allocate "
  18. "interrupt number for %pOF\n", np))
  19. continue;
  20. rc = request_irq(virq, handler, 0, name, NULL);
  21. if (WARN(rc, "event-sources: Unable to request interrupt %d for %pOF\n",
  22. virq, np))
  23. return;
  24. }
  25. }