diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-01-22 16:59:25 -0800 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-01-24 11:21:36 -0800 |
commit | 5c7ddb5ddf1fe1d9f8c68e7deefe3bd53e1e3e8c (patch) | |
tree | 15dc34f45c1414e9a658775868090a7eb67cb1b9 /libusb/os/sunos_usb.c | |
parent | aaff15d48d1b8555aabf012b06bf39bf8aa4768a (diff) | |
download | libusb-5c7ddb5ddf1fe1d9f8c68e7deefe3bd53e1e3e8c.tar.gz |
Misc: Cleanup across multiple backends
Remove the clear_transfer_priv() function from all backends besides
Linux. This function is only needed if the backend calls
usbi_handle_disconnect(), which only Linux does.
Remove the {attach,detach}_kernel_driver() functions from the Darwin
backend. They return LIBUSB_ERROR_NOT_SUPPORTED, but the same result is
achieved by having those functions be NULL.
Remove the init() and exit() functions from the SunOS backend. They are
optional and as no-ops are pointless.
Remove NULL and 0 initializers from usbi_backend structures.
Use named initializers in the NetBSD backend.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb/os/sunos_usb.c')
-rw-r--r-- | libusb/os/sunos_usb.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/libusb/os/sunos_usb.c b/libusb/os/sunos_usb.c index 6960033..20aefe8 100644 --- a/libusb/os/sunos_usb.c +++ b/libusb/os/sunos_usb.c @@ -79,7 +79,6 @@ static int sunos_reset_device(struct libusb_device_handle *); static void sunos_destroy_device(struct libusb_device *); static int sunos_submit_transfer(struct usbi_transfer *); static int sunos_cancel_transfer(struct usbi_transfer *); -static void sunos_clear_transfer_priv(struct usbi_transfer *); static int sunos_handle_transfer_completion(struct usbi_transfer *); static int sunos_clock_gettime(int, struct timespec *); static int sunos_kernel_driver_active(struct libusb_device_handle *, int interface); @@ -245,16 +244,6 @@ sunos_kernel_driver_active(struct libusb_device_handle *dev, int interface) static int _errno_to_libusb(int); static int sunos_usb_get_status(int fd); -static int sunos_init(struct libusb_context *ctx) -{ - return (LIBUSB_SUCCESS); -} - -static void sunos_exit(struct libusb_context *ctx) -{ - usbi_dbg(""); -} - static string_list_t * sunos_new_string_list(void) { @@ -1511,14 +1500,6 @@ sunos_cancel_transfer(struct usbi_transfer *itransfer) return (ret); } -void -sunos_clear_transfer_priv(struct usbi_transfer *itransfer) -{ - usbi_dbg(""); - - /* Nothing to do */ -} - int sunos_handle_transfer_completion(struct usbi_transfer *itransfer) { @@ -1670,33 +1651,25 @@ static clockid_t op_get_timerfd_clockid(void) const struct usbi_os_backend usbi_backend = { .name = "Solaris", .caps = 0, - .init = sunos_init, - .exit = sunos_exit, .get_device_list = sunos_get_device_list, .get_device_descriptor = sunos_get_device_descriptor, .get_active_config_descriptor = sunos_get_active_config_descriptor, .get_config_descriptor = sunos_get_config_descriptor, - .hotplug_poll = NULL, .open = sunos_open, .close = sunos_close, .get_configuration = sunos_get_configuration, .set_configuration = sunos_set_configuration, - .claim_interface = sunos_claim_interface, .release_interface = sunos_release_interface, .set_interface_altsetting = sunos_set_interface_altsetting, .clear_halt = sunos_clear_halt, .reset_device = sunos_reset_device, /* TODO */ - .alloc_streams = NULL, - .free_streams = NULL, .kernel_driver_active = sunos_kernel_driver_active, .detach_kernel_driver = sunos_detach_kernel_driver, .attach_kernel_driver = sunos_attach_kernel_driver, .destroy_device = sunos_destroy_device, .submit_transfer = sunos_submit_transfer, .cancel_transfer = sunos_cancel_transfer, - .handle_events = NULL, - .clear_transfer_priv = sunos_clear_transfer_priv, .handle_transfer_completion = sunos_handle_transfer_completion, .clock_gettime = sunos_clock_gettime, #ifdef USBI_TIMERFD_AVAILABLE |