PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 6#include <linux/interrupt.h>
 7#include <linux/of_irq.h>
 8
 9#include "pseries.h"
10
11void request_event_sources_irqs(struct device_node *np,
12				irq_handler_t handler,
13				const char *name)
14{
15	int i, virq, rc;
16
17	for (i = 0; i < 16; i++) {
18		virq = of_irq_get(np, i);
19		if (virq < 0)
20			return;
21		if (WARN(!virq, "event-sources: Unable to allocate "
22			        "interrupt number for %pOF\n", np))
23			continue;
24
25		rc = request_irq(virq, handler, 0, name, NULL);
26		if (WARN(rc, "event-sources: Unable to request interrupt %d for %pOF\n",
27		    virq, np))
28			return;
29	}
30}