Commit edd81e7c authored by Juergen Gross's avatar Juergen Gross

xen/usb: switch xen-hcd to use INVALID_GRANT_REF

Instead of using a private macro for an invalid grant reference use
the common one.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 70920be6
......@@ -87,8 +87,6 @@ struct xenhcd_info {
bool error;
};
#define GRANT_INVALID_REF 0
#define XENHCD_RING_JIFFIES (HZ/200)
#define XENHCD_SCAN_JIFFIES 1
......@@ -1100,17 +1098,17 @@ static void xenhcd_destroy_rings(struct xenhcd_info *info)
unbind_from_irqhandler(info->irq, info);
info->irq = 0;
if (info->urb_ring_ref != GRANT_INVALID_REF) {
if (info->urb_ring_ref != INVALID_GRANT_REF) {
gnttab_end_foreign_access(info->urb_ring_ref,
(unsigned long)info->urb_ring.sring);
info->urb_ring_ref = GRANT_INVALID_REF;
info->urb_ring_ref = INVALID_GRANT_REF;
}
info->urb_ring.sring = NULL;
if (info->conn_ring_ref != GRANT_INVALID_REF) {
if (info->conn_ring_ref != INVALID_GRANT_REF) {
gnttab_end_foreign_access(info->conn_ring_ref,
(unsigned long)info->conn_ring.sring);
info->conn_ring_ref = GRANT_INVALID_REF;
info->conn_ring_ref = INVALID_GRANT_REF;
}
info->conn_ring.sring = NULL;
}
......@@ -1123,8 +1121,8 @@ static int xenhcd_setup_rings(struct xenbus_device *dev,
grant_ref_t gref;
int err;
info->urb_ring_ref = GRANT_INVALID_REF;
info->conn_ring_ref = GRANT_INVALID_REF;
info->urb_ring_ref = INVALID_GRANT_REF;
info->conn_ring_ref = INVALID_GRANT_REF;
urb_sring = (struct xenusb_urb_sring *)get_zeroed_page(
GFP_NOIO | __GFP_HIGH);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment