Remove all return error checks for event_set_handler(...). It either
succeeds or end in panic.
This commit is contained in:
parent
849a1cbddc
commit
6d90e19e1d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: evtchn.c,v 1.47 2010/12/20 00:25:46 matt Exp $ */
|
||||
/* $NetBSD: evtchn.c,v 1.48 2011/07/02 19:07:56 jym Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006 Manuel Bouyer.
|
||||
@ -54,7 +54,7 @@
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.47 2010/12/20 00:25:46 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.48 2011/07/02 19:07:56 jym Exp $");
|
||||
|
||||
#include "opt_xen.h"
|
||||
#include "isa.h"
|
||||
@ -420,10 +420,8 @@ pirq_establish(int pirq, int evtch, int (*func)(void *), void *arg, int level,
|
||||
printf("pirq_establish: can't malloc handler info\n");
|
||||
return NULL;
|
||||
}
|
||||
if (event_set_handler(evtch, pirq_interrupt, ih, level, evname) != 0) {
|
||||
free(ih, M_DEVBUF);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
event_set_handler(evtch, pirq_interrupt, ih, level, evname);
|
||||
ih->pirq = pirq;
|
||||
ih->evtch = evtch;
|
||||
ih->func = func;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xenbus_comms.c,v 1.12 2009/01/16 20:16:47 jym Exp $ */
|
||||
/* $NetBSD: xenbus_comms.c,v 1.13 2011/07/02 19:07:56 jym Exp $ */
|
||||
/******************************************************************************
|
||||
* xenbus_comms.c
|
||||
*
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.12 2009/01/16 20:16:47 jym Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.13 2011/07/02 19:07:56 jym Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/null.h>
|
||||
@ -218,17 +218,12 @@ xb_read(void *data, unsigned len)
|
||||
int
|
||||
xb_init_comms(device_t dev)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (xenbus_irq)
|
||||
event_remove_handler(xenbus_irq, wake_waiting, NULL);
|
||||
|
||||
err = event_set_handler(xen_start_info.store_evtchn, wake_waiting,
|
||||
event_set_handler(xen_start_info.store_evtchn, wake_waiting,
|
||||
NULL, IPL_TTY, "xenbus");
|
||||
if (err) {
|
||||
aprint_error_dev(dev, "request irq failed %i\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
xenbus_irq = xen_start_info.store_evtchn;
|
||||
aprint_verbose_dev(dev, "using event channel %d\n", xenbus_irq);
|
||||
hypervisor_enable_event(xenbus_irq);
|
||||
|
Loading…
Reference in New Issue
Block a user