/* Free an existing event channel. Returns 0 on success or -errno on error.  */
int xenbus_free_evtchn(struct xenbus_device *dev, int port)
/* Free an existing event channel. Returns 0 on success or -errno on error.  */
int xenbus_free_evtchn(struct xenbus_device *dev, int port)
{
	struct evtchn_close close;
	int err;
	close.port = port;
	err = HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
	if (err)
		xenbus_dev_error(dev, err, "freeing event channel %d", port);
	return err;
}