mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git
synced 2024-11-14 14:33:44 +08:00
lsusb: make internal API const-aware
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
parent
dd97b758be
commit
1a1185f914
11
lsusb.c
11
lsusb.c
@ -151,7 +151,7 @@ static void dump_midistreaming_interface(libusb_device_handle *dev, const unsign
|
||||
static void dump_videocontrol_interface(libusb_device_handle *dev, const unsigned char *buf, int protocol);
|
||||
static void dump_videostreaming_interface(const unsigned char *buf);
|
||||
static void dump_dfu_interface(const unsigned char *buf);
|
||||
static char *dump_comm_descriptor(libusb_device_handle *dev, const unsigned char *buf, char *indent);
|
||||
static void dump_comm_descriptor(libusb_device_handle *dev, const unsigned char *buf, const char *indent);
|
||||
static void dump_hid_device(libusb_device_handle *dev, const struct libusb_interface_descriptor *interface, const unsigned char *buf);
|
||||
static void dump_printer_device(libusb_device_handle *dev, const struct libusb_interface_descriptor *interface, const unsigned char *buf);
|
||||
static void dump_audiostreaming_endpoint(libusb_device_handle *dev, const unsigned char *buf, int protocol);
|
||||
@ -2538,8 +2538,8 @@ static void dump_hid_device(libusb_device_handle *dev,
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
dump_comm_descriptor(libusb_device_handle *dev, const unsigned char *buf, char *indent)
|
||||
static void
|
||||
dump_comm_descriptor(libusb_device_handle *dev, const unsigned char *buf, const char *indent)
|
||||
{
|
||||
int tmp;
|
||||
char *str = NULL;
|
||||
@ -2818,17 +2818,16 @@ dump_comm_descriptor(libusb_device_handle *dev, const unsigned char *buf, char *
|
||||
/* FIXME there are about a dozen more descriptor types */
|
||||
printf("%sUNRECOGNIZED CDC: ", indent);
|
||||
dump_bytes(buf, buf[0]);
|
||||
return "unrecognized comm descriptor";
|
||||
return;
|
||||
}
|
||||
|
||||
free(str);
|
||||
|
||||
return 0;
|
||||
return;
|
||||
|
||||
bad:
|
||||
printf("%sINVALID CDC (%s): ", indent, type);
|
||||
dump_bytes(buf, buf[0]);
|
||||
return "corrupt comm descriptor";
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
2
sysfs.c
2
sysfs.c
@ -50,7 +50,7 @@ int get_sysfs_name(char *buf, size_t size, libusb_device *dev)
|
||||
return len;
|
||||
}
|
||||
|
||||
int read_sysfs_prop(char *buf, size_t size, char *sysfs_name, char *propname)
|
||||
int read_sysfs_prop(char *buf, size_t size, const char *sysfs_name, const char *propname)
|
||||
{
|
||||
int n, fd;
|
||||
char path[PATH_MAX];
|
||||
|
2
sysfs.h
2
sysfs.h
@ -10,7 +10,7 @@
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int get_sysfs_name(char *buf, size_t size, libusb_device *dev);
|
||||
extern int read_sysfs_prop(char *buf, size_t size, char *sysfs_name, char *propname);
|
||||
extern int read_sysfs_prop(char *buf, size_t size, const char *sysfs_name, const char *propname);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
#endif /* _SYSFS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user