From 9f8e32dfca2aab9dea8a9db335e3a783b0035507 Mon Sep 17 00:00:00 2001 From: Jaejoong Kim Date: Fri, 20 Oct 2017 16:29:15 +0900 Subject: usb: misc: usbtest: remove duplicate & operation usb_endpoint_maxp() has an inline keyword and searches for bits[10:0] by & operation with 0x7ff. So, we can remove the duplicate & operation with 0x7ff. Signed-off-by: Jaejoong Kim Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usbtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index b3fc602b2e24..3639e00a51a0 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1909,7 +1909,7 @@ static struct urb *iso_alloc_urb( if (bytes < 0 || !desc) return NULL; - maxp = 0x7ff & usb_endpoint_maxp(desc); + maxp = usb_endpoint_maxp(desc); maxp *= usb_endpoint_maxp_mult(desc); packets = DIV_ROUND_UP(bytes, maxp); -- cgit From 7fcf55847178c644f3bbe127b72a0c6dc378419a Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:04 +0300 Subject: usb: usb251xb: Add USB2517i specific struct and IDs There are USB2517 and USB2517i hubs, which have almost the same registers space as already supported USB251xBi series. The difference it in DIDs and in a few functions. This patch adds the USB2517/i data structures to the driver, so it would have different setting depending on the device discovered on i2c-bus. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/Kconfig | 4 ++-- drivers/usb/misc/usb251xb.c | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig index 0f9f25db9163..68d2f2cd17dd 100644 --- a/drivers/usb/misc/Kconfig +++ b/drivers/usb/misc/Kconfig @@ -238,8 +238,8 @@ config USB_HUB_USB251XB depends on I2C help This option enables support for configuration via SMBus of the - Microchip USB251xB/xBi USB 2.0 Hub Controller series. - Configuration parameters may be set in devicetree or platform data. + Microchip USB251x/xBi USB 2.0 Hub Controller series. Configuration + parameters may be set in devicetree or platform data. Say Y or M here if you need to configure such a device via SMBus. config USB_HSIC_USB3503 diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 135c91c434bf..1bfdad832e85 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -38,6 +38,7 @@ #define USB251XB_DEF_PRODUCT_ID_12 0x2512 /* USB2512B/12Bi */ #define USB251XB_DEF_PRODUCT_ID_13 0x2513 /* USB2513B/13Bi */ #define USB251XB_DEF_PRODUCT_ID_14 0x2514 /* USB2514B/14Bi */ +#define USB251XB_DEF_PRODUCT_ID_17 0x2517 /* USB2517/17i */ #define USB251XB_ADDR_DEVICE_ID_LSB 0x04 #define USB251XB_ADDR_DEVICE_ID_MSB 0x05 @@ -82,7 +83,7 @@ #define USB251XB_ADDR_PRODUCT_STRING_LEN 0x14 #define USB251XB_ADDR_PRODUCT_STRING 0x54 -#define USB251XB_DEF_PRODUCT_STRING "USB251xB/xBi" +#define USB251XB_DEF_PRODUCT_STRING "USB251xB/xBi/7i" #define USB251XB_ADDR_SERIAL_STRING_LEN 0x15 #define USB251XB_ADDR_SERIAL_STRING 0x92 @@ -185,6 +186,16 @@ static const struct usb251xb_data usb2514bi_data = { .product_str = "USB2514Bi", }; +static const struct usb251xb_data usb2517_data = { + .product_id = 0x2517, + .product_str = "USB2517", +}; + +static const struct usb251xb_data usb2517i_data = { + .product_id = 0x2517, + .product_str = "USB2517i", +}; + static void usb251xb_reset(struct usb251xb *hub, int state) { if (!gpio_is_valid(hub->gpio_reset)) @@ -509,6 +520,12 @@ static const struct of_device_id usb251xb_of_match[] = { }, { .compatible = "microchip,usb2514bi", .data = &usb2514bi_data, + }, { + .compatible = "microchip,usb2517", + .data = &usb2517_data, + }, { + .compatible = "microchip,usb2517i", + .data = &usb2517i_data, }, { /* sentinel */ } @@ -573,6 +590,8 @@ static const struct i2c_device_id usb251xb_id[] = { { "usb2513bi", 0 }, { "usb2514b", 0 }, { "usb2514bi", 0 }, + { "usb2517", 0 }, + { "usb2517i", 0 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, usb251xb_id); @@ -589,5 +608,5 @@ static struct i2c_driver usb251xb_i2c_driver = { module_i2c_driver(usb251xb_i2c_driver); MODULE_AUTHOR("Richard Leitner "); -MODULE_DESCRIPTION("USB251xB/xBi USB 2.0 Hub Controller Driver"); +MODULE_DESCRIPTION("USB251x/xBi USB 2.0 Hub Controller Driver"); MODULE_LICENSE("GPL"); -- cgit From 384811286f2db6845758eb5789b0dec015d40719 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:05 +0300 Subject: usb: usb251xb: Add USB251x specific port count setting USB251xb as well as USB2517 datasheet states, that all these hubs differ by number of ports declared as the last digit in the model name. So USB2512 got two ports, USB2513 - three, and so on. Such setting must be reflected in the device specific data structure and corresponding dts property should be checked whether it doesn't get out of available ports. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 1bfdad832e85..e49158bb3a02 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -153,46 +153,55 @@ struct usb251xb { struct usb251xb_data { u16 product_id; + u8 port_cnt; char product_str[USB251XB_STRING_BUFSIZE / 2]; /* ASCII string */ }; static const struct usb251xb_data usb2512b_data = { .product_id = 0x2512, + .port_cnt = 2, .product_str = "USB2512B", }; static const struct usb251xb_data usb2512bi_data = { .product_id = 0x2512, + .port_cnt = 2, .product_str = "USB2512Bi", }; static const struct usb251xb_data usb2513b_data = { .product_id = 0x2513, + .port_cnt = 3, .product_str = "USB2513B", }; static const struct usb251xb_data usb2513bi_data = { .product_id = 0x2513, + .port_cnt = 3, .product_str = "USB2513Bi", }; static const struct usb251xb_data usb2514b_data = { .product_id = 0x2514, + .port_cnt = 4, .product_str = "USB2514B", }; static const struct usb251xb_data usb2514bi_data = { .product_id = 0x2514, + .port_cnt = 4, .product_str = "USB2514Bi", }; static const struct usb251xb_data usb2517_data = { .product_id = 0x2517, + .port_cnt = 7, .product_str = "USB2517", }; static const struct usb251xb_data usb2517i_data = { .product_id = 0x2517, + .port_cnt = 7, .product_str = "USB2517i", }; @@ -421,8 +430,11 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, for (i = 0; i < len / sizeof(u32); i++) { u32 port = be32_to_cpu(cproperty_u32[i]); - if ((port >= 1) && (port <= 4)) + if ((port >= 1) && (port <= data->port_cnt)) hub->non_rem_dev |= BIT(port); + else + dev_warn(dev, "NRD port %u doesn't exist\n", + port); } } @@ -432,8 +444,11 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, for (i = 0; i < len / sizeof(u32); i++) { u32 port = be32_to_cpu(cproperty_u32[i]); - if ((port >= 1) && (port <= 4)) + if ((port >= 1) && (port <= data->port_cnt)) hub->port_disable_sp |= BIT(port); + else + dev_warn(dev, "PDS port %u doesn't exist\n", + port); } } @@ -443,8 +458,11 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, for (i = 0; i < len / sizeof(u32); i++) { u32 port = be32_to_cpu(cproperty_u32[i]); - if ((port >= 1) && (port <= 4)) + if ((port >= 1) && (port <= data->port_cnt)) hub->port_disable_bp |= BIT(port); + else + dev_warn(dev, "PDB port %u doesn't exist\n", + port); } } -- cgit From db234b9a1b571a5f57917a3a0aeb7d53d9e1aa75 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:06 +0300 Subject: usb: usb251xb: Add 5,6,7 ports mapping def setting USB2517 got three additionl downstream ports, which can as well be mapped to another logical ports. USB251xb driver currently doesn't fully support such setting configuration from dts file. This patch doesn't change this, but adds usb2517 spcific ports default liner mapping. Signed-off-by: Serge Semin Acked-by: Richard Leitner Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index e49158bb3a02..202e931c697a 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -103,7 +103,11 @@ #define USB251XB_ADDR_PORT_MAP_12 0xFB #define USB251XB_DEF_PORT_MAP_12 0x00 #define USB251XB_ADDR_PORT_MAP_34 0xFC -#define USB251XB_DEF_PORT_MAP_34 0x00 /* USB2513B/i & USB2514B/i only */ +#define USB251XB_DEF_PORT_MAP_34 0x00 /* USB251{3B/i,4B/i,7/i} only */ +#define USB251XB_ADDR_PORT_MAP_56 0xFD +#define USB251XB_DEF_PORT_MAP_56 0x00 /* USB2517/i only */ +#define USB251XB_ADDR_PORT_MAP_7 0xFE +#define USB251XB_DEF_PORT_MAP_7 0x00 /* USB2517/i only */ #define USB251XB_ADDR_STATUS_COMMAND 0xFF #define USB251XB_STATUS_COMMAND_SMBUS_DOWN 0x04 @@ -148,6 +152,8 @@ struct usb251xb { u8 port_swap; u8 port_map12; u8 port_map34; + u8 port_map56; + u8 port_map7; u8 status; }; @@ -277,6 +283,8 @@ static int usb251xb_connect(struct usb251xb *hub) i2c_wb[USB251XB_ADDR_PORT_SWAP] = hub->port_swap; i2c_wb[USB251XB_ADDR_PORT_MAP_12] = hub->port_map12; i2c_wb[USB251XB_ADDR_PORT_MAP_34] = hub->port_map34; + i2c_wb[USB251XB_ADDR_PORT_MAP_56] = hub->port_map56; + i2c_wb[USB251XB_ADDR_PORT_MAP_7] = hub->port_map7; i2c_wb[USB251XB_ADDR_STATUS_COMMAND] = USB251XB_STATUS_COMMAND_ATTACH; usb251xb_reset(hub, 1); @@ -515,6 +523,8 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, hub->port_swap = USB251XB_DEF_PORT_SWAP; hub->port_map12 = USB251XB_DEF_PORT_MAP_12; hub->port_map34 = USB251XB_DEF_PORT_MAP_34; + hub->port_map56 = USB251XB_DEF_PORT_MAP_56; + hub->port_map7 = USB251XB_DEF_PORT_MAP_7; return 0; } -- cgit From ccdddc0343b8a1955ca9217e02d693546f792392 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:07 +0300 Subject: usb: usb251xb: Add 5,6,7 ports boost settings USB electrical signaling drive strength boost bit is also supported by USB2517 hub. Since it got three addition ports, the designers needed to add one more register for initialization. It turned out to be formerly reserved 0xF7. As before we just initialize it with default zeros. Signed-off-by: Serge Semin Acked-by: Richard Leitner Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 202e931c697a..530ef13b353d 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -94,8 +94,10 @@ #define USB251XB_ADDR_BOOST_UP 0xF6 #define USB251XB_DEF_BOOST_UP 0x00 -#define USB251XB_ADDR_BOOST_X 0xF8 -#define USB251XB_DEF_BOOST_X 0x00 +#define USB251XB_ADDR_BOOST_57 0xF7 +#define USB251XB_DEF_BOOST_57 0x00 +#define USB251XB_ADDR_BOOST_14 0xF8 +#define USB251XB_DEF_BOOST_14 0x00 #define USB251XB_ADDR_PORT_SWAP 0xFA #define USB251XB_DEF_PORT_SWAP 0x00 @@ -148,7 +150,8 @@ struct usb251xb { char serial[USB251XB_STRING_BUFSIZE]; u8 bat_charge_en; u8 boost_up; - u8 boost_x; + u8 boost_57; + u8 boost_14; u8 port_swap; u8 port_map12; u8 port_map34; @@ -279,7 +282,8 @@ static int usb251xb_connect(struct usb251xb *hub) USB251XB_STRING_BUFSIZE); i2c_wb[USB251XB_ADDR_BATTERY_CHARGING_ENABLE] = hub->bat_charge_en; i2c_wb[USB251XB_ADDR_BOOST_UP] = hub->boost_up; - i2c_wb[USB251XB_ADDR_BOOST_X] = hub->boost_x; + i2c_wb[USB251XB_ADDR_BOOST_57] = hub->boost_57; + i2c_wb[USB251XB_ADDR_BOOST_14] = hub->boost_14; i2c_wb[USB251XB_ADDR_PORT_SWAP] = hub->port_swap; i2c_wb[USB251XB_ADDR_PORT_MAP_12] = hub->port_map12; i2c_wb[USB251XB_ADDR_PORT_MAP_34] = hub->port_map34; @@ -519,7 +523,8 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, hub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS; hub->bat_charge_en = USB251XB_DEF_BATTERY_CHARGING_ENABLE; hub->boost_up = USB251XB_DEF_BOOST_UP; - hub->boost_x = USB251XB_DEF_BOOST_X; + hub->boost_57 = USB251XB_DEF_BOOST_57; + hub->boost_14 = USB251XB_DEF_BOOST_14; hub->port_swap = USB251XB_DEF_PORT_SWAP; hub->port_map12 = USB251XB_DEF_PORT_MAP_12; hub->port_map34 = USB251XB_DEF_PORT_MAP_34; -- cgit From dd99d106de255eb48ad7fce8a44afe3ee1526cef Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:08 +0300 Subject: usb: usb251xb: Add battery enable setting flag Battery charging settings are supported by USB251xb hubs only. USB2517i isn't one of them. So we need to reflect it within the device-specific data structure. The driver doesn't support dts property changing this setting, but instead defaults it with zero. So the flag isn't used anywhere in the driver, but still can be helpful in future, when necessity of the corresponding dts setting arises. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 530ef13b353d..5b1c4f565d2f 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -163,54 +163,63 @@ struct usb251xb { struct usb251xb_data { u16 product_id; u8 port_cnt; + bool bat_support; char product_str[USB251XB_STRING_BUFSIZE / 2]; /* ASCII string */ }; static const struct usb251xb_data usb2512b_data = { .product_id = 0x2512, .port_cnt = 2, + .bat_support = true, .product_str = "USB2512B", }; static const struct usb251xb_data usb2512bi_data = { .product_id = 0x2512, .port_cnt = 2, + .bat_support = true, .product_str = "USB2512Bi", }; static const struct usb251xb_data usb2513b_data = { .product_id = 0x2513, .port_cnt = 3, + .bat_support = true, .product_str = "USB2513B", }; static const struct usb251xb_data usb2513bi_data = { .product_id = 0x2513, .port_cnt = 3, + .bat_support = true, .product_str = "USB2513Bi", }; static const struct usb251xb_data usb2514b_data = { .product_id = 0x2514, .port_cnt = 4, + .bat_support = true, .product_str = "USB2514B", }; static const struct usb251xb_data usb2514bi_data = { .product_id = 0x2514, .port_cnt = 4, + .bat_support = true, .product_str = "USB2514Bi", }; static const struct usb251xb_data usb2517_data = { .product_id = 0x2517, .port_cnt = 7, + .bat_support = false, .product_str = "USB2517", }; static const struct usb251xb_data usb2517i_data = { .product_id = 0x2517, .port_cnt = 7, + .bat_support = false, .product_str = "USB2517i", }; -- cgit From 2818e13ae174bf6a607db3e3fc405bbf5f66b1ce Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:09 +0300 Subject: usb: usb251xb: Add USB2517 LED settings USB2517 supports two LED modes: USB mode and speed (default) indication mode. The last one can be switched on by corresponding dts property. Since USB251xb hubs doesn't support LEDs settings, we need to ignore this setting. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 5b1c4f565d2f..5263b8acc772 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -163,6 +163,7 @@ struct usb251xb { struct usb251xb_data { u16 product_id; u8 port_cnt; + bool led_support; bool bat_support; char product_str[USB251XB_STRING_BUFSIZE / 2]; /* ASCII string */ }; @@ -170,6 +171,7 @@ struct usb251xb_data { static const struct usb251xb_data usb2512b_data = { .product_id = 0x2512, .port_cnt = 2, + .led_support = false, .bat_support = true, .product_str = "USB2512B", }; @@ -177,6 +179,7 @@ static const struct usb251xb_data usb2512b_data = { static const struct usb251xb_data usb2512bi_data = { .product_id = 0x2512, .port_cnt = 2, + .led_support = false, .bat_support = true, .product_str = "USB2512Bi", }; @@ -184,6 +187,7 @@ static const struct usb251xb_data usb2512bi_data = { static const struct usb251xb_data usb2513b_data = { .product_id = 0x2513, .port_cnt = 3, + .led_support = false, .bat_support = true, .product_str = "USB2513B", }; @@ -191,6 +195,7 @@ static const struct usb251xb_data usb2513b_data = { static const struct usb251xb_data usb2513bi_data = { .product_id = 0x2513, .port_cnt = 3, + .led_support = false, .bat_support = true, .product_str = "USB2513Bi", }; @@ -198,6 +203,7 @@ static const struct usb251xb_data usb2513bi_data = { static const struct usb251xb_data usb2514b_data = { .product_id = 0x2514, .port_cnt = 4, + .led_support = false, .bat_support = true, .product_str = "USB2514B", }; @@ -205,6 +211,7 @@ static const struct usb251xb_data usb2514b_data = { static const struct usb251xb_data usb2514bi_data = { .product_id = 0x2514, .port_cnt = 4, + .led_support = false, .bat_support = true, .product_str = "USB2514Bi", }; @@ -212,6 +219,7 @@ static const struct usb251xb_data usb2514bi_data = { static const struct usb251xb_data usb2517_data = { .product_id = 0x2517, .port_cnt = 7, + .led_support = true, .bat_support = false, .product_str = "USB2517", }; @@ -219,6 +227,7 @@ static const struct usb251xb_data usb2517_data = { static const struct usb251xb_data usb2517i_data = { .product_id = 0x2517, .port_cnt = 7, + .led_support = true, .bat_support = false, .product_str = "USB2517i", }; @@ -442,6 +451,9 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, if (of_get_property(np, "port-mapping-mode", NULL)) hub->conf_data3 |= BIT(3); + if (data->led_support && of_get_property(np, "led-usb-mode", NULL)) + hub->conf_data3 &= ~BIT(1); + if (of_get_property(np, "string-support", NULL)) hub->conf_data3 |= BIT(0); -- cgit From 287c2bb6e1b5b1299da59537fe58515001286c85 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:10 +0300 Subject: usb: usb251xb: Fix property_u32 NULL pointer dereference The methods like of_property_read_u32 utilizing the specified pointer permit only the pointer to a preallocated u32 storage as the third argument. As a result the driver crashes on NULL pointer dereference in case if "oc-delay-us" or "power-on-time-ms" declared in dts file. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 5263b8acc772..333f61baf145 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -347,7 +347,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, struct device *dev = hub->dev; struct device_node *np = dev->of_node; int len, err, i; - u32 *property_u32 = NULL; + u32 property_u32 = 0; const u32 *cproperty_u32; const char *cproperty_char; char str[USB251XB_STRING_BUFSIZE / 2]; @@ -424,16 +424,16 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, if (of_get_property(np, "dynamic-power-switching", NULL)) hub->conf_data2 |= BIT(7); - if (!of_property_read_u32(np, "oc-delay-us", property_u32)) { - if (*property_u32 == 100) { + if (!of_property_read_u32(np, "oc-delay-us", &property_u32)) { + if (property_u32 == 100) { /* 100 us*/ hub->conf_data2 &= ~BIT(5); hub->conf_data2 &= ~BIT(4); - } else if (*property_u32 == 4000) { + } else if (property_u32 == 4000) { /* 4 ms */ hub->conf_data2 &= ~BIT(5); hub->conf_data2 |= BIT(4); - } else if (*property_u32 == 16000) { + } else if (property_u32 == 16000) { /* 16 ms */ hub->conf_data2 |= BIT(5); hub->conf_data2 |= BIT(4); @@ -500,8 +500,8 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, } hub->power_on_time = USB251XB_DEF_POWER_ON_TIME; - if (!of_property_read_u32(np, "power-on-time-ms", property_u32)) - hub->power_on_time = min_t(u8, *property_u32 / 2, 255); + if (!of_property_read_u32(np, "power-on-time-ms", &property_u32)) + hub->power_on_time = min_t(u8, property_u32 / 2, 255); if (of_property_read_u16_array(np, "language-id", &hub->lang_id, 1)) hub->lang_id = USB251XB_DEF_LANGUAGE_ID; -- cgit From 4ed466ae69692c851fcd4ea7f02b696df7804712 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:11 +0300 Subject: usb: usb251xb: Add max power/current dts property support This parameters may be varied in accordance with hardware specifics. So lets add the corresponding settings to the usb251xb driver dts specification. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 333f61baf145..11ec78e45282 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -499,6 +499,26 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, } } + hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; + if (!of_property_read_u32(np, "sp-max-total-current-microamp", + &property_u32)) + hub->max_power_sp = min_t(u8, property_u32 / 2000, 50); + + hub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS; + if (!of_property_read_u32(np, "bp-max-total-current-microamp", + &property_u32)) + hub->max_power_bp = min_t(u8, property_u32 / 2000, 255); + + hub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF; + if (!of_property_read_u32(np, "sp-max-removable-current-microamp", + &property_u32)) + hub->max_current_sp = min_t(u8, property_u32 / 2000, 50); + + hub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS; + if (!of_property_read_u32(np, "bp-max-removable-current-microamp", + &property_u32)) + hub->max_current_bp = min_t(u8, property_u32 / 2000, 255); + hub->power_on_time = USB251XB_DEF_POWER_ON_TIME; if (!of_property_read_u32(np, "power-on-time-ms", &property_u32)) hub->power_on_time = min_t(u8, property_u32 / 2, 255); @@ -538,10 +558,6 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, /* The following parameters are currently not exposed to devicetree, but * may be as soon as needed. */ - hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; - hub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS; - hub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF; - hub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS; hub->bat_charge_en = USB251XB_DEF_BATTERY_CHARGING_ENABLE; hub->boost_up = USB251XB_DEF_BOOST_UP; hub->boost_57 = USB251XB_DEF_BOOST_57; -- cgit From 69a0c69aab9622186e7b93f1b900a8e17effbcd9 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sun, 22 Oct 2017 23:38:12 +0300 Subject: usb: usb251xb: Use GPIO descriptor consumer interface The driver used to be developed with legacy GPIO API support. It's better to use descriptor-based interface for several reasons. First of all the legacy API doesn't support the ACTIVE_LOW/HIGH flag of dts nodes, which is essential since different hardware may have different GPIOs connectivity including the logical value inversion. Secondly, by requesting the reset GPIO descriptor the driver prevent the other applications from changing its value. And last but not least the legacy GPIO interface should be avoided in the new code due to it obsolescence. Signed-off-by: Serge Semin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usb251xb.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 11ec78e45282..9c8f7e2b6740 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -20,12 +20,11 @@ */ #include -#include +#include #include #include #include #include -#include #include /* Internal Register Set Addresses & Default Values acc. to DS00001692C */ @@ -126,7 +125,7 @@ struct usb251xb { struct device *dev; struct i2c_client *i2c; u8 skip_config; - int gpio_reset; + struct gpio_desc *gpio_reset; u16 vendor_id; u16 product_id; u16 device_id; @@ -234,13 +233,13 @@ static const struct usb251xb_data usb2517i_data = { static void usb251xb_reset(struct usb251xb *hub, int state) { - if (!gpio_is_valid(hub->gpio_reset)) + if (!hub->gpio_reset) return; - gpio_set_value_cansleep(hub->gpio_reset, state); + gpiod_set_value_cansleep(hub->gpio_reset, state); /* wait for hub recovery/stabilization */ - if (state) + if (!state) usleep_range(500, 750); /* >=500us at power on */ else usleep_range(1, 10); /* >=1us at power down */ @@ -259,7 +258,7 @@ static int usb251xb_connect(struct usb251xb *hub) i2c_wb[0] = 0x01; i2c_wb[1] = USB251XB_STATUS_COMMAND_ATTACH; - usb251xb_reset(hub, 1); + usb251xb_reset(hub, 0); err = i2c_smbus_write_i2c_block_data(hub->i2c, USB251XB_ADDR_STATUS_COMMAND, 2, i2c_wb); @@ -309,7 +308,7 @@ static int usb251xb_connect(struct usb251xb *hub) i2c_wb[USB251XB_ADDR_PORT_MAP_7] = hub->port_map7; i2c_wb[USB251XB_ADDR_STATUS_COMMAND] = USB251XB_STATUS_COMMAND_ATTACH; - usb251xb_reset(hub, 1); + usb251xb_reset(hub, 0); /* write registers */ for (i = 0; i < (USB251XB_I2C_REG_SZ / USB251XB_I2C_WRITE_SZ); i++) { @@ -362,19 +361,13 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, else hub->skip_config = 0; - hub->gpio_reset = of_get_named_gpio(np, "reset-gpios", 0); - if (hub->gpio_reset == -EPROBE_DEFER) + hub->gpio_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (PTR_ERR(hub->gpio_reset) == -EPROBE_DEFER) { return -EPROBE_DEFER; - if (gpio_is_valid(hub->gpio_reset)) { - err = devm_gpio_request_one(dev, hub->gpio_reset, - GPIOF_OUT_INIT_LOW, - "usb251xb reset"); - if (err) { - dev_err(dev, - "unable to request GPIO %d as reset pin (%d)\n", - hub->gpio_reset, err); - return err; - } + } else if (IS_ERR(hub->gpio_reset)) { + err = PTR_ERR(hub->gpio_reset); + dev_err(dev, "unable to request GPIO reset pin (%d)\n", err); + return err; } if (of_property_read_u16_array(np, "vendor-id", &hub->vendor_id, 1)) -- cgit From 5fd54ace4721fc5ce2bb5aef6318fcf17f421460 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 3 Nov 2017 11:28:30 +0100 Subject: USB: add SPDX identifiers to all remaining files in drivers/usb/ It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/usb/ and include/linux/usb* files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Signed-off-by: Greg Kroah-Hartman Acked-by: Felipe Balbi Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/adutux.c | 1 + drivers/usb/misc/appledisplay.c | 1 + drivers/usb/misc/chaoskey.c | 1 + drivers/usb/misc/cypress_cy7c63.c | 1 + drivers/usb/misc/cytherm.c | 1 + drivers/usb/misc/ehset.c | 1 + drivers/usb/misc/emi26.c | 1 + drivers/usb/misc/emi62.c | 1 + drivers/usb/misc/ezusb.c | 1 + drivers/usb/misc/ftdi-elan.c | 1 + drivers/usb/misc/idmouse.c | 1 + drivers/usb/misc/iowarrior.c | 1 + drivers/usb/misc/isight_firmware.c | 1 + drivers/usb/misc/ldusb.c | 1 + drivers/usb/misc/legousbtower.c | 1 + drivers/usb/misc/lvstest.c | 1 + drivers/usb/misc/rio500.c | 1 + drivers/usb/misc/rio500_usb.h | 1 + drivers/usb/misc/sisusbvga/sisusb.c | 1 + drivers/usb/misc/sisusbvga/sisusb.h | 1 + drivers/usb/misc/sisusbvga/sisusb_con.c | 1 + drivers/usb/misc/sisusbvga/sisusb_init.c | 1 + drivers/usb/misc/sisusbvga/sisusb_init.h | 1 + drivers/usb/misc/sisusbvga/sisusb_struct.h | 1 + drivers/usb/misc/trancevibrator.c | 1 + drivers/usb/misc/usb251xb.c | 1 + drivers/usb/misc/usb3503.c | 1 + drivers/usb/misc/usb4604.c | 1 + drivers/usb/misc/usb_u132.h | 1 + drivers/usb/misc/usblcd.c | 1 + drivers/usb/misc/usbsevseg.c | 1 + drivers/usb/misc/usbtest.c | 1 + drivers/usb/misc/uss720.c | 1 + drivers/usb/misc/yurex.c | 1 + 34 files changed, 34 insertions(+) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index 1c0ada75c35d..092db5ae5fa1 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * adutux - driver for ADU devices from Ontrak Control Systems * This is an experimental driver. Use at your own risk. diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 8efdc500e790..b75defc52c24 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Apple Cinema Display driver * diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c index abec6e604a62..8a22b4997c5f 100644 --- a/drivers/usb/misc/chaoskey.c +++ b/drivers/usb/misc/chaoskey.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * chaoskey - driver for ChaosKey device from Altus Metrum. * diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index 5c93a888c40e..819ad8dc2376 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * cypress_cy7c63.c * diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 63207c42acf6..a65f8817ecf8 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* -*- linux-c -*- * Cypress USB Thermometer driver * diff --git a/drivers/usb/misc/ehset.c b/drivers/usb/misc/ehset.c index c31b4a33e6bb..8b8e25424aa1 100644 --- a/drivers/usb/misc/ehset.c +++ b/drivers/usb/misc/ehset.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index 8950fa5e973d..81836e9d787f 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Emagic EMI 2|6 usb audio interface firmware loader. * Copyright (C) 2002 diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index 1d9be4431b72..fad894a63c52 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Emagic EMI 2|6 usb audio interface firmware loader. * Copyright (C) 2002 diff --git a/drivers/usb/misc/ezusb.c b/drivers/usb/misc/ezusb.c index 837208f14f86..c9be0d484e5c 100644 --- a/drivers/usb/misc/ezusb.c +++ b/drivers/usb/misc/ezusb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * EZ-USB specific functions used by some of the USB to Serial drivers. * diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 424ff12f3b51..c1fbc2a32eb2 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * USB FTDI client driver for Elan Digital Systems's Uxxx adapters * diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index 39d8fedfaf3b..8d144903f05e 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* Siemens ID Mouse driver v0.6 This program is free software; you can redistribute it and/or diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index be5881303681..ad3109490c0f 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Native support for the I/O-Warrior USB devices * diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c index 1c61830e96f9..91c028f16d31 100644 --- a/drivers/usb/misc/isight_firmware.c +++ b/drivers/usb/misc/isight_firmware.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for loading USB isight firmware * diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 680bddb3ce05..0f01dd3b59d0 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /** * Generic USB driver for report based interrupt in/out devices * like LD Didactic's USB devices. LD Didactic's USB devices are diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 5628f678ab59..cd4d49d8aea5 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * LEGO USB Tower driver * diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c index ddddd6387f66..5e5d128e16c0 100644 --- a/drivers/usb/misc/lvstest.c +++ b/drivers/usb/misc/lvstest.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * drivers/usb/misc/lvstest.c * diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index ddfebb144aaa..84bd682e9e61 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* -*- linux-c -*- */ /* diff --git a/drivers/usb/misc/rio500_usb.h b/drivers/usb/misc/rio500_usb.h index 359abc98e706..ce2ac1099d86 100644 --- a/drivers/usb/misc/rio500_usb.h +++ b/drivers/usb/misc/rio500_usb.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* ---------------------------------------------------------------------- Copyright (C) 2000 Cesar Miquel (miquel@df.uba.ar) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 30774e0aeadd..3e65bdc2615c 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) /* * sisusb - usb kernel driver for SiS315(E) based USB2VGA dongles * diff --git a/drivers/usb/misc/sisusbvga/sisusb.h b/drivers/usb/misc/sisusbvga/sisusb.h index 55492a5930bd..20f03ad0ea16 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.h +++ b/drivers/usb/misc/sisusbvga/sisusb.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) /* * sisusb - usb kernel driver for Net2280/SiS315 based USB2VGA dongles * diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index f019d80ca9e4..73f7bde78e11 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) /* * sisusb - usb kernel driver for SiS315(E) based USB2VGA dongles * diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c index bf0032ca35ed..6a30e8bd9221 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/drivers/usb/misc/sisusbvga/sisusb_init.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) /* * sisusb - usb kernel driver for SiS315(E) based USB2VGA dongles * diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.h b/drivers/usb/misc/sisusbvga/sisusb_init.h index e79a616f0d26..1782c759c4ad 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.h +++ b/drivers/usb/misc/sisusbvga/sisusb_init.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) /* $XFree86$ */ /* $XdotOrg$ */ /* diff --git a/drivers/usb/misc/sisusbvga/sisusb_struct.h b/drivers/usb/misc/sisusbvga/sisusb_struct.h index 1c4240e802c1..706d77090e00 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_struct.h +++ b/drivers/usb/misc/sisusbvga/sisusb_struct.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) /* * General structure definitions for universal mode switching modules * diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index 1862ed15ce28..405726b8ebe6 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * PlayStation 2 Trance Vibrator driver * diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 9c8f7e2b6740..5234bc3e0f01 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for Microchip USB251xB USB 2.0 Hi-Speed Hub Controller * Configuration via SMBus. diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index 8e7737d7ac0a..b5416f887fbf 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for SMSC USB3503 USB 2.0 hub controller driver * diff --git a/drivers/usb/misc/usb4604.c b/drivers/usb/misc/usb4604.c index e9f37fb746ac..40fa85807aae 100644 --- a/drivers/usb/misc/usb4604.c +++ b/drivers/usb/misc/usb4604.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for SMSC USB4604 USB HSIC 4-port 2.0 hub controller driver * Based on usb3503 driver diff --git a/drivers/usb/misc/usb_u132.h b/drivers/usb/misc/usb_u132.h index dc2e5a31caec..4dbfea3237f7 100644 --- a/drivers/usb/misc/usb_u132.h +++ b/drivers/usb/misc/usb_u132.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common Header File for the Elan Digital Systems U132 adapter * this file should be included by both the "ftdi-u132" and diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 0f5ad896c7e3..9ba4a4e68d91 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /***************************************************************************** * USBLCD Kernel Driver * * Version 1.05 * diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index 3f6a28045b53..4990d5757019 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * USB 7 Segment Driver * diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 3639e00a51a0..aeda01f037c1 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index 8a13b2fcf3e1..876a7a32defc 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /*****************************************************************************/ /* diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 58abdf28620a..1aec1d25ee44 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for Meywa-Denki & KAYAC YUREX * -- cgit From 5d62afbe9572138a25d67b8468d27ec65777824d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 3 Nov 2017 12:40:58 +0100 Subject: USB: misc: Remove redundant license text Now that the SPDX tag is in all USB files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Keith Packard Cc: Juergen Stuber Cc: Cesar Miquel Cc: Richard Leitner Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/adutux.c | 5 ----- drivers/usb/misc/appledisplay.c | 14 -------------- drivers/usb/misc/chaoskey.c | 9 --------- drivers/usb/misc/cypress_cy7c63.c | 4 ---- drivers/usb/misc/cytherm.c | 5 ----- drivers/usb/misc/ehset.c | 9 --------- drivers/usb/misc/emi26.c | 4 ---- drivers/usb/misc/emi62.c | 4 ---- drivers/usb/misc/ezusb.c | 4 ---- drivers/usb/misc/ftdi-elan.c | 5 ----- drivers/usb/misc/idmouse.c | 5 ----- drivers/usb/misc/isight_firmware.c | 4 ---- drivers/usb/misc/ldusb.c | 5 ----- drivers/usb/misc/legousbtower.c | 5 ----- drivers/usb/misc/lvstest.c | 4 ---- drivers/usb/misc/rio500.c | 14 -------------- drivers/usb/misc/rio500_usb.h | 18 ------------------ drivers/usb/misc/trancevibrator.c | 14 -------------- drivers/usb/misc/usb251xb.c | 10 ---------- drivers/usb/misc/usb3503.c | 14 -------------- drivers/usb/misc/usb4604.c | 10 ---------- drivers/usb/misc/usb_u132.h | 5 ----- drivers/usb/misc/usbsevseg.c | 5 ----- drivers/usb/misc/uss720.c | 14 -------------- drivers/usb/misc/yurex.c | 5 ----- 25 files changed, 195 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index 092db5ae5fa1..e9195a7103a8 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -6,11 +6,6 @@ * * Copyright (c) 2003 John Homppi (SCO, leave this notice here) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * * derived from the Lego USB Tower driver 0.56: * Copyright (c) 2003 David Glance * 2001 Juergen Stuber diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index b75defc52c24..b3eb8b989bd4 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -5,20 +5,6 @@ * Copyright (C) 2006 Michael Hanselmann (linux-kernel@hansmi.ch) * * Thanks to Caskey L. Dickson for his work with acdctl. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c index 8a22b4997c5f..b6a1b9331aa0 100644 --- a/drivers/usb/misc/chaoskey.c +++ b/drivers/usb/misc/chaoskey.c @@ -12,15 +12,6 @@ * bit stream. * * Copyright © 2015 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. */ #include diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index 819ad8dc2376..bf4d2778907e 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c @@ -24,10 +24,6 @@ * * For up-to-date information please visit: * http://www.obock.de/kernel/cypress -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation, version 2. */ #include diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index a65f8817ecf8..66be86077292 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -7,11 +7,6 @@ * This driver works with Elektor magazine USB Interface as published in * issue #291. It should also work with the original starter kit/demo board * from Cypress. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * */ diff --git a/drivers/usb/misc/ehset.c b/drivers/usb/misc/ehset.c index 8b8e25424aa1..7895d61e733b 100644 --- a/drivers/usb/misc/ehset.c +++ b/drivers/usb/misc/ehset.c @@ -1,15 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index 81836e9d787f..24d841850e05 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c @@ -4,10 +4,6 @@ * Copyright (C) 2002 * Tapio Laxström (tapio.laxstrom@iptime.fi) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, as published by - * the Free Software Foundation, version 2. - * * emi26.c,v 1.13 2002/03/08 13:10:26 tapio Exp */ #include diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index fad894a63c52..3eea60437f56 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c @@ -3,10 +3,6 @@ * Emagic EMI 2|6 usb audio interface firmware loader. * Copyright (C) 2002 * Tapio Laxström (tapio.laxstrom@iptime.fi) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, as published by - * the Free Software Foundation, version 2. */ #include #include diff --git a/drivers/usb/misc/ezusb.c b/drivers/usb/misc/ezusb.c index c9be0d484e5c..f058d8029761 100644 --- a/drivers/usb/misc/ezusb.c +++ b/drivers/usb/misc/ezusb.c @@ -3,10 +3,6 @@ * EZ-USB specific functions used by some of the USB to Serial drivers. * * Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation. */ #include diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index c1fbc2a32eb2..76c718ac8c78 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -8,11 +8,6 @@ * Author and Maintainer - Tony Olech - Elan Digital Systems * tony.olech@elandigitalsystems.com * - * This program is free software;you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - * * This driver was written by Tony Olech(tony.olech@elandigitalsystems.com) * based on various USB client drivers in the 2.6.15 linux kernel * with constant reference to the 3rd Edition of Linux Device Drivers diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index 8d144903f05e..20b0f91a5d9b 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -1,11 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* Siemens ID Mouse driver v0.6 - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - Copyright (C) 2004-5 by Florian 'Floe' Echtler and Andreas 'ad' Deresch diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c index 91c028f16d31..4d30095d6ad2 100644 --- a/drivers/usb/misc/isight_firmware.c +++ b/drivers/usb/misc/isight_firmware.c @@ -4,10 +4,6 @@ * * Copyright (C) 2008 Matthew Garrett * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, version 2. - * * The USB isight cameras in recent Apples are roughly compatible with the USB * video class specification, and can be driven by uvcvideo. However, they * need firmware to be loaded beforehand. After firmware loading, the device diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 0f01dd3b59d0..5c1a3b852453 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -13,11 +13,6 @@ * * Copyright (C) 2005 Michael Hund * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * * Derived from Lego USB Tower driver * Copyright (C) 2003 David Glance * 2001-2004 Juergen Stuber diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index cd4d49d8aea5..c5be6e9e24a5 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -5,11 +5,6 @@ * Copyright (C) 2003 David Glance * 2001-2004 Juergen Stuber * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * * derived from USB Skeleton driver - 0.5 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) * diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c index 5e5d128e16c0..e5c03c6d16e9 100644 --- a/drivers/usb/misc/lvstest.c +++ b/drivers/usb/misc/lvstest.c @@ -6,10 +6,6 @@ * * Copyright (C) 2014 ST Microelectronics * Pratyush Anand - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. */ #include diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 84bd682e9e61..7b9adeb3e7aa 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c @@ -7,20 +7,6 @@ * Cesar Miquel (miquel@df.uba.ar) * * based on hp_scanner.c by David E. Nelson (dnelson@jump.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based upon mouse.c (Brad Keryan) and printer.c (Michael Gee). * diff --git a/drivers/usb/misc/rio500_usb.h b/drivers/usb/misc/rio500_usb.h index ce2ac1099d86..6db7a5863496 100644 --- a/drivers/usb/misc/rio500_usb.h +++ b/drivers/usb/misc/rio500_usb.h @@ -1,26 +1,8 @@ // SPDX-License-Identifier: GPL-2.0+ /* ---------------------------------------------------------------------- - Copyright (C) 2000 Cesar Miquel (miquel@df.uba.ar) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------- */ - - #define RIO_SEND_COMMAND 0x1 #define RIO_RECV_COMMAND 0x2 diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index 405726b8ebe6..d83af2a332e4 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -3,20 +3,6 @@ * PlayStation 2 Trance Vibrator driver * * Copyright (C) 2006 Sam Hocevar - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Standard include files */ diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 5234bc3e0f01..a6efb9a72939 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -8,16 +8,6 @@ * This work is based on the USB3503 driver by Dongjin Kim and * a not-accepted patch by Fabien Lahoudere, see: * https://patchwork.kernel.org/patch/9257715/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index b5416f887fbf..465dbf68b463 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -3,20 +3,6 @@ * Driver for SMSC USB3503 USB 2.0 hub controller driver * * Copyright (c) 2012-2013 Dongjin Kim (tobetter@gmail.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/usb/misc/usb4604.c b/drivers/usb/misc/usb4604.c index 40fa85807aae..1b4de651e697 100644 --- a/drivers/usb/misc/usb4604.c +++ b/drivers/usb/misc/usb4604.c @@ -5,16 +5,6 @@ * * Copyright (c) 2012-2013 Dongjin Kim (tobetter@gmail.com) * Copyright (c) 2016 Linaro Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/usb/misc/usb_u132.h b/drivers/usb/misc/usb_u132.h index 4dbfea3237f7..4bf77736914f 100644 --- a/drivers/usb/misc/usb_u132.h +++ b/drivers/usb/misc/usb_u132.h @@ -10,11 +10,6 @@ * Author and Maintainer - Tony Olech - Elan Digital Systems *(tony.olech@elandigitalsystems.com) * -* This program is free software;you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation, version 2. -* -* * The driver was written by Tony Olech(tony.olech@elandigitalsystems.com) * based on various USB client drivers in the 2.6.15 linux kernel * with constant reference to the 3rd Edition of Linux Device Drivers diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index 4990d5757019..12f7e94695a2 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c @@ -4,11 +4,6 @@ * * Copyright (C) 2008 Harrison Metzger * Based on usbled.c by Greg Kroah-Hartman (greg@kroah.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * */ #include diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index 876a7a32defc..263c97fec708 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -7,20 +7,6 @@ * Copyright (C) 1999, 2005, 2010 * Thomas Sailer (t.sailer@alumni.ethz.ch) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * * Based on parport_pc.c * * History: diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 1aec1d25ee44..8abb6cbbd98a 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -3,11 +3,6 @@ * Driver for Meywa-Denki & KAYAC YUREX * * Copyright (C) 2010 Tomoki Sekiyama (tomoki.sekiyama@gmail.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * */ #include -- cgit From d9e1e1484ade396b3a979ba6c68798dbaceed1b9 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 2 Nov 2017 10:57:40 +0200 Subject: usb: core: introduce a new usb_get_std_status() helper This new helper is a simple wrapper around usb_get_status(). This patch is in preparation to adding support for fetching PTM_STATUS types. No functional changes. Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usbtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index aeda01f037c1..203f29894bce 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1016,7 +1016,7 @@ static int ch9_postconfig(struct usbtest_dev *dev) /* FIXME fetch strings from at least the device descriptor */ /* [9.4.5] get_status always works */ - retval = usb_get_status(udev, USB_RECIP_DEVICE, 0, dev->buf); + retval = usb_get_std_status(udev, USB_RECIP_DEVICE, 0, dev->buf); if (retval) { dev_err(&iface->dev, "get dev status --> %d\n", retval); return retval; @@ -1026,7 +1026,7 @@ static int ch9_postconfig(struct usbtest_dev *dev) * the device's remote wakeup feature ... if we can, test that here */ - retval = usb_get_status(udev, USB_RECIP_INTERFACE, + retval = usb_get_std_status(udev, USB_RECIP_INTERFACE, iface->altsetting[0].desc.bInterfaceNumber, dev->buf); if (retval) { dev_err(&iface->dev, "get interface status --> %d\n", retval); @@ -1615,7 +1615,7 @@ static int verify_not_halted(struct usbtest_dev *tdev, int ep, struct urb *urb) u16 status; /* shouldn't look or act halted */ - retval = usb_get_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); + retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); if (retval < 0) { ERROR(tdev, "ep %02x couldn't get no-halt status, %d\n", ep, retval); @@ -1637,7 +1637,7 @@ static int verify_halted(struct usbtest_dev *tdev, int ep, struct urb *urb) u16 status; /* should look and act halted */ - retval = usb_get_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); + retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); if (retval < 0) { ERROR(tdev, "ep %02x couldn't get halt status, %d\n", ep, retval); -- cgit From 8444efc4a052332d643ed5c8aebcca148c7de032 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 7 Nov 2017 11:45:27 +0000 Subject: USB: adutux: remove redundant variable minor Variable minor is being assigned but never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/usb/misc/adutux.c:770:2: warning: Value stored to 'minor' is never read Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/adutux.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index e9195a7103a8..4b8712733fc7 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -757,13 +757,11 @@ error: static void adu_disconnect(struct usb_interface *interface) { struct adu_device *dev; - int minor; dev = usb_get_intfdata(interface); mutex_lock(&dev->mtx); /* not interruptible */ dev->udev = NULL; /* poison */ - minor = dev->minor; usb_deregister_dev(interface, &adu_class); mutex_unlock(&dev->mtx); -- cgit From 3efe891f61479a98edc5c3c7b91b92b69d99e592 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Nov 2017 16:34:07 +0100 Subject: USB: add SPDX identifiers to all remaining Makefiles It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. This updates the remaining drivers/usb/*Makefile* that were missing SPDX identifiers. They all get the following identifier: SPDX-License-Identifier: GPL-2.0 The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Peter Korsgaard Cc: Thomas Winischhofer Cc: Johan Hovold Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/sisusbvga/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/misc') diff --git a/drivers/usb/misc/sisusbvga/Makefile b/drivers/usb/misc/sisusbvga/Makefile index 3142476ccc8e..6ed3a638261a 100644 --- a/drivers/usb/misc/sisusbvga/Makefile +++ b/drivers/usb/misc/sisusbvga/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 # # Makefile for the sisusb driver (if driver is inside kernel tree). # -- cgit