From 1109ef2dc48779edb875a009b75784228acfb316 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Sat, 19 Oct 2013 08:29:31 +0000 Subject: Make uhub_explore() return an int rather than a usbd_satus. This has no direct impact since its return value is never checked but it allows me to get rid of one (usless) status value. Note that usbd_status should be used for USB transfers. --- sys/dev/usb/uhub.c | 15 ++++++++------- sys/dev/usb/usbdivar.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index bba5322fc14..26d913d7739 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.62 2013/05/21 17:44:30 mpi Exp $ */ +/* $OpenBSD: uhub.c,v 1.63 2013/10/19 08:29:30 mpi Exp $ */ /* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ @@ -69,7 +69,7 @@ struct uhub_softc { #define UHUB_IS_HIGH_SPEED(sc) (UHUB_PROTO(sc) != UDPROTO_FSHUB) #define UHUB_IS_SINGLE_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT) -usbd_status uhub_explore(struct usbd_device *hub); +int uhub_explore(struct usbd_device *hub); void uhub_intr(struct usbd_xfer *, void *, usbd_status); /* @@ -326,7 +326,7 @@ uhub_attach(struct device *parent, struct device *self, void *aux) dev->hub = NULL; } -usbd_status +int uhub_explore(struct usbd_device *dev) { usb_hub_descriptor_t *hd = &dev->hub->hubdesc; @@ -338,14 +338,14 @@ uhub_explore(struct usbd_device *dev) int change, status, reconnect; if (usbd_is_dying(dev)) - return (USBD_IOERROR); + return (EIO); if (!sc->sc_running) - return (USBD_NOT_STARTED); + return (ENXIO); /* Ignore hubs that are too deep. */ if (dev->depth > USB_HUB_MAX_DEPTH) - return (USBD_TOO_DEEP); + return (EOPNOTSUPP); for (port = 1; port <= hd->bNbrPorts; port++) { up = &dev->hub->ports[port-1]; @@ -476,7 +476,8 @@ uhub_explore(struct usbd_device *dev) up->device->hub->explore(up->device); } } - return (USBD_NORMAL_COMPLETION); + + return (0); } int diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h index e8e739abd68..34428f10727 100644 --- a/sys/dev/usb/usbdivar.h +++ b/sys/dev/usb/usbdivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdivar.h,v 1.51 2013/08/13 09:26:05 mpi Exp $ */ +/* $OpenBSD: usbdivar.h,v 1.52 2013/10/19 08:29:30 mpi Exp $ */ /* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */ @@ -84,7 +84,7 @@ struct usbd_port { }; struct usbd_hub { - usbd_status (*explore)(struct usbd_device *hub); + int (*explore)(struct usbd_device *hub); void *hubsoftc; usb_hub_descriptor_t hubdesc; struct usbd_port *ports; -- cgit v1.2.3