aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenbus/xenbus_dev_backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xenbus/xenbus_dev_backend.c')
-rw-r--r--drivers/xen/xenbus/xenbus_dev_backend.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/xen/xenbus/xenbus_dev_backend.c b/drivers/xen/xenbus/xenbus_dev_backend.c
index d73000800762..a6f42fc01407 100644
--- a/drivers/xen/xenbus/xenbus_dev_backend.c
+++ b/drivers/xen/xenbus/xenbus_dev_backend.c
@@ -70,22 +70,21 @@ static long xenbus_alloc(domid_t domid)
70 return err; 70 return err;
71} 71}
72 72
73static long xenbus_backend_ioctl(struct file *file, unsigned int cmd, unsigned long data) 73static long xenbus_backend_ioctl(struct file *file, unsigned int cmd,
74 unsigned long data)
74{ 75{
75 if (!capable(CAP_SYS_ADMIN)) 76 if (!capable(CAP_SYS_ADMIN))
76 return -EPERM; 77 return -EPERM;
77 78
78 switch (cmd) { 79 switch (cmd) {
79 case IOCTL_XENBUS_BACKEND_EVTCHN: 80 case IOCTL_XENBUS_BACKEND_EVTCHN:
80 if (xen_store_evtchn > 0) 81 if (xen_store_evtchn > 0)
81 return xen_store_evtchn; 82 return xen_store_evtchn;
82 return -ENODEV; 83 return -ENODEV;
83 84 case IOCTL_XENBUS_BACKEND_SETUP:
84 case IOCTL_XENBUS_BACKEND_SETUP: 85 return xenbus_alloc(data);
85 return xenbus_alloc(data); 86 default:
86 87 return -ENOTTY;
87 default:
88 return -ENOTTY;
89 } 88 }
90} 89}
91 90