Skip to content

Commit 9ed714d

Browse files
committed
Merge tag 'usb-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB driver fixes from Greg KH: "Here are some small USB driver fixes and new device ids for 5.19-rc7. They include: - new usb-serial driver ids - typec uevent fix - uvc gadget driver fix - dwc3 driver fixes - ehci-fsl driver fix All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: ftdi_sio: add Belimo device ids drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode. usb: gadget: uvc: fix changing interface name via configfs usb: typec: add missing uevent when partner support PD usb: dwc3-am62: remove unnecesary clk_put() usb: dwc3: gadget: Fix event pending check
2 parents 8c91723 + 3486af8 commit 9ed714d

File tree

8 files changed

+25
-17
lines changed

8 files changed

+25
-17
lines changed

drivers/usb/dwc3/dwc3-am62.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,15 @@ static int dwc3_ti_probe(struct platform_device *pdev)
195195

196196
if (i == ARRAY_SIZE(dwc3_ti_rate_table)) {
197197
dev_err(dev, "unsupported usb2_refclk rate: %lu KHz\n", rate);
198-
ret = -EINVAL;
199-
goto err_clk_disable;
198+
return -EINVAL;
200199
}
201200

202201
data->rate_code = i;
203202

204203
/* Read the syscon property and set the rate code */
205204
ret = phy_syscon_pll_refclk(data);
206205
if (ret)
207-
goto err_clk_disable;
206+
return ret;
208207

209208
/* VBUS divider select */
210209
data->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider");
@@ -245,8 +244,6 @@ static int dwc3_ti_probe(struct platform_device *pdev)
245244
clk_disable_unprepare(data->usb2_refclk);
246245
pm_runtime_disable(dev);
247246
pm_runtime_set_suspended(dev);
248-
err_clk_disable:
249-
clk_put(data->usb2_refclk);
250247
return ret;
251248
}
252249

@@ -276,7 +273,6 @@ static int dwc3_ti_remove(struct platform_device *pdev)
276273
pm_runtime_disable(dev);
277274
pm_runtime_set_suspended(dev);
278275

279-
clk_put(data->usb2_refclk);
280276
platform_set_drvdata(pdev, NULL);
281277
return 0;
282278
}

drivers/usb/dwc3/gadget.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4249,7 +4249,6 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt)
42494249
}
42504250

42514251
evt->count = 0;
4252-
evt->flags &= ~DWC3_EVENT_PENDING;
42534252
ret = IRQ_HANDLED;
42544253

42554254
/* Unmask interrupt */
@@ -4261,6 +4260,9 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt)
42614260
dwc3_writel(dwc->regs, DWC3_DEV_IMOD(0), dwc->imod_interval);
42624261
}
42634262

4263+
/* Keep the clearing of DWC3_EVENT_PENDING at the end */
4264+
evt->flags &= ~DWC3_EVENT_PENDING;
4265+
42644266
return ret;
42654267
}
42664268

drivers/usb/gadget/function/uvc_configfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,6 +2371,7 @@ static ssize_t f_uvc_opts_string_##cname##_store(struct config_item *item,\
23712371
const char *page, size_t len) \
23722372
{ \
23732373
struct f_uvc_opts *opts = to_f_uvc_opts(item); \
2374+
int size = min(sizeof(opts->aname), len + 1); \
23742375
int ret = 0; \
23752376
\
23762377
mutex_lock(&opts->lock); \
@@ -2379,8 +2380,9 @@ static ssize_t f_uvc_opts_string_##cname##_store(struct config_item *item,\
23792380
goto end; \
23802381
} \
23812382
\
2382-
ret = snprintf(opts->aname, min(sizeof(opts->aname), len), \
2383-
"%s", page); \
2383+
ret = strscpy(opts->aname, page, size); \
2384+
if (ret == -E2BIG) \
2385+
ret = size - 1; \
23842386
\
23852387
end: \
23862388
mutex_unlock(&opts->lock); \

drivers/usb/host/ehci-fsl.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
7676
return -ENODEV;
7777
}
7878

79-
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
80-
if (!res) {
81-
dev_err(&pdev->dev,
82-
"Found HC with no IRQ. Check %s setup!\n",
83-
dev_name(&pdev->dev));
84-
return -ENODEV;
85-
}
86-
irq = res->start;
79+
irq = platform_get_irq(pdev, 0);
80+
if (irq < 0)
81+
return irq;
8782

8883
hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent,
8984
&pdev->dev, dev_name(&pdev->dev), NULL);

drivers/usb/host/fsl-mph-dr-of.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register(
112112
goto error;
113113
}
114114

115+
pdev->dev.of_node = ofdev->dev.of_node;
116+
pdev->dev.of_node_reused = true;
117+
115118
retval = platform_device_add(pdev);
116119
if (retval)
117120
goto error;

drivers/usb/serial/ftdi_sio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,9 @@ static const struct usb_device_id id_table_combined[] = {
10231023
{ USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) },
10241024
{ USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) },
10251025
{ USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) },
1026+
/* Belimo Automation devices */
1027+
{ USB_DEVICE(FTDI_VID, BELIMO_ZTH_PID) },
1028+
{ USB_DEVICE(FTDI_VID, BELIMO_ZIP_PID) },
10261029
/* ICP DAS I-756xU devices */
10271030
{ USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) },
10281031
{ USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) },

drivers/usb/serial/ftdi_sio_ids.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,12 @@
15681568
#define CHETCO_SEASMART_LITE_PID 0xA5AE /* SeaSmart Lite USB Adapter */
15691569
#define CHETCO_SEASMART_ANALOG_PID 0xA5AF /* SeaSmart Analog Adapter */
15701570

1571+
/*
1572+
* Belimo Automation
1573+
*/
1574+
#define BELIMO_ZTH_PID 0x8050
1575+
#define BELIMO_ZIP_PID 0xC811
1576+
15711577
/*
15721578
* Unjo AB
15731579
*/

drivers/usb/typec/class.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,7 @@ void typec_set_pwr_opmode(struct typec_port *port,
17181718
partner->usb_pd = 1;
17191719
sysfs_notify(&partner_dev->kobj, NULL,
17201720
"supports_usb_power_delivery");
1721+
kobject_uevent(&partner_dev->kobj, KOBJ_CHANGE);
17211722
}
17221723
put_device(partner_dev);
17231724
}

0 commit comments

Comments
 (0)