diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h b/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h index 96fce4cc68..a241a25781 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h +++ b/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h @@ -90,15 +90,6 @@ void uninit_driver(); bool usb_serial_service(struct tty *tty, uint32 op, void *buffer, size_t length); -status_t usb_serial_open(const char *name, uint32 flags, void **cookie); -status_t usb_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes); -status_t usb_serial_write(void *cookie, off_t position, const void *buffer, size_t *numBytes); -status_t usb_serial_control(void *cookie, uint32 op, void *arg, size_t length); -status_t usb_serial_select(void *cookie, uint8 event, uint32 ref, selectsync *sync); -status_t usb_serial_deselect(void *coookie, uint8 event, selectsync *sync); -status_t usb_serial_close(void *cookie); -status_t usb_serial_free(void *cookie); - const char **publish_devices(); device_hooks *find_device(const char *name); } diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp index 8fa547db87..5209f11dbe 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp +++ b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp @@ -5,6 +5,8 @@ * Copyright (c) 2003 by Siarzhuk Zharski * Distributed under the terms of the MIT License. */ +#include + #include "SerialDevice.h" #include "USB3.h" @@ -637,7 +639,7 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID, if (!description) break; - return new ProlificDevice(device, vendorID, productID, description); + return new(std::nothrow) ProlificDevice(device, vendorID, productID, description); } case VENDOR_FTDI: @@ -650,7 +652,7 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID, if (!description) break; - return new FTDIDevice(device, vendorID, productID, description); + return new(std::nothrow) FTDIDevice(device, vendorID, productID, description); } case VENDOR_PALM: @@ -664,9 +666,9 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID, if (!description) break; - return new KLSIDevice(device, vendorID, productID, description); + return new(std::nothrow) KLSIDevice(device, vendorID, productID, description); } } - return new ACMDevice(device, vendorID, productID, "CDC ACM compatible device"); + return new(std::nothrow) ACMDevice(device, vendorID, productID, "CDC ACM compatible device"); } diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp index 78a406e908..95d1823857 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp +++ b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp @@ -70,7 +70,7 @@ create_log_file() void -usb_serial_trace(bool force, char *format, ...) +usb_serial_trace(bool force, const char *format, ...) { if (!gLogEnabled && !force) return; diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h index 6b90a7e8e2..6b00eec217 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h +++ b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h @@ -10,7 +10,7 @@ void load_settings(); void create_log_file(); -void usb_serial_trace(bool force, char *format, ...); +void usb_serial_trace(bool force, const char *format, ...); #define TRACE_ALWAYS(x...) usb_serial_trace(true, x); #define TRACE(x...) usb_serial_trace(false, x);