[PATCH -next] usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock()

2018-07-31 Thread Wei Yongjun
In case of error, the function pcim_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 7740d04d901d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not") Signed-off-by: W

[PATCH -next] usb: typec: altmodes: Fix missing unlock on error in dp_altmode_activate()

2018-07-04 Thread Wei Yongjun
Add the missing unlock before return from function dp_altmode_activate() in the error handling case. Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode") Signed-off-by: Wei Yongjun --- drivers/usb/typec/altmodes/displayport.c | 6 -- 1 file changed, 4

[PATCH -next] usb: dwc3: Fix error return code in dwc3_qcom_probe()

2018-06-06 Thread Wei Yongjun
Fix to return error code -ENODEV from the get device failed error handling case instead of 0, as done elsewhere in this function. Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Signed-off-by: Wei Yongjun --- drivers/usb/dwc3/dwc3-qcom.c | 1 + 1 file changed, 1

[PATCH -next] USB: dwc3: make function dwc3_get_extcon() static

2018-05-22 Thread Wei Yongjun
Fixes the following sparse warnings: drivers/usb/dwc3/drd.c:443:19: warning: symbol 'dwc3_get_extcon' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/dwc3/drd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH -next] usb: dwc3: gadget: dwc3_gadget_del_and_unmap_request() can be static

2018-03-28 Thread Wei Yongjun
Fixes the following sparse warning: drivers/usb/dwc3/gadget.c:169:6: warning: symbol 'dwc3_gadget_del_and_unmap_request' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH -next] usb: roles: Fix potential NULL dereference in intel_xhci_usb_probe()

2018-03-28 Thread Wei Yongjun
); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap_nocache(e1, res->start, e2); Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/roles/intel-xhci-usb-role-switch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/roles/intel-xhci-usb-role

[PATCH -next] usb: dwc2: pci: Fix error return code in dwc2_pci_probe()

2018-03-28 Thread Wei Yongjun
Fix to return error code -ENOMEM from the alloc fail error handling case instead of 0, as done elsewhere in this function. Fixes: ecd29dabb2ba ("usb: dwc2: pci: Handle error cleanup in probe") Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/dwc2/pci.c | 4 +++-

[PATCH -next] usb: roles: Fix return value check in intel_xhci_usb_probe()

2018-03-26 Thread Wei Yongjun
In case of error, the function devm_ioremap_nocache() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: f6fb9ec02be1 ("usb: roles: Add Intel xHCI USB role switch driver") Signed-off-by: Wei Yongjun <weiyongj.

[PATCH -next] USB: gadget: udc: Add missing platform_device_put() on error in bdc_pci_probe()

2018-01-23 Thread Wei Yongjun
Add the missing platform_device_put() before return from bdc_pci_probe() in the platform_device_add_resources() error handling case. Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") Signed-off-by: Wei Yongjun <weiyongj...@huawei.com&

[PATCH -next] usb: dwc2: Fix the error handling of dwc2_pci_probe()

2017-02-07 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fix the error handling of dwc2_pci_probe() to avoid resources leak. Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/dwc2/pci.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a

[PATCH -next] usb: mtu3: remove redundant dev_err call in get_ssusb_rscs()

2017-02-05 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/mtu3/mtu3_plat.c | 4 +--- 1 file changed, 1 ins

[PATCH -next] usb: chipidea: msm: Fix return value check in ci_hdrc_msm_probe()

2017-01-25 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 2fc305be364e ("usb: chipidea: msm: Mux over secondary phy at the

[PATCH net-next] cdc-ether: usbnet_cdc_zte_status() can be static

2017-01-12 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fixes the following sparse warning: drivers/net/usb/cdc_ether.c:469:6: warning: symbol 'usbnet_cdc_zte_status' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/net/usb/cdc_ether.c |

[PATCH -next] usb: xhci-mem: make xhci_free_virt_devices_depth_first() static

2017-01-12 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fixes the following sparse warning: drivers/usb/host/xhci-mem.c:988:6: warning: symbol 'xhci_free_virt_devices_depth_first' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/hos

[PATCH -next] usb: musb: dsps: make dsps_musb_clear_ep_rxintr() static

2017-01-11 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fixes the following sparse warning: drivers/usb/musb/musb_dsps.c:270:6: warning: symbol 'dsps_musb_clear_ep_rxintr' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/musb/musb_dsps

[PATCH -next] usb: ohci-da8xx: remove redundant dev_err call in usb_hcd_da8xx_probe()

2016-10-29 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/host/ohci-da8xx.c | 1 - 1 file changed, 1 delet

[PATCH -next] wusb: fix error return code in wusb_prf()

2016-10-19 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fix to return error code -ENOMEM from the kmalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: a19b882c07a6 ("wusb: Stop using the stack for sg crypto scratch space") Signed-off-by: Wei Yongjun <wei

[PATCH -next] usb: musb: am35x: fix error return code in am35x_probe()

2016-09-10 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fix to return a negative error code from the usb_phy_generic_register() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/musb/am35x.c | 4 +++- 1 fil

[PATCH -next] usb: host: xhci-tegra: Fix error return code in tegra_xusb_probe()

2016-09-10 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fix to return error code -ENOMEM from the usb_create_shared_hcd() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/host/xhci-tegra.c | 1 + 1 fil

[PATCH -next] USB: host: ohci-at91: fix non static symbol warning

2016-09-10 Thread Wei Yongjun
From: Wei Yongjun <weiyongj...@huawei.com> Fixes the following sparse warning: drivers/usb/host/ohci-at91.c:141:15: warning: symbol 'at91_dt_syscon_sfr' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> --- drivers/usb/host/ohci-at91.c |

[PATCH -next] xhci: fix non static symbol warning

2016-08-20 Thread Wei Yongjun
Fixes the following sparse warning: drivers/usb/host/xhci-ring.c:608:6: warning: symbol 'xhci_unmap_td_bounce_buffer' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyj...@gmail.com> --- drivers/usb/host/xhci-ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH -next] usb: renesas_usbhs: gadget: fix return value check in usbhs_mod_gadget_probe()

2016-08-12 Thread Wei Yongjun
In case of error, the function usb_get_phy() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyj...@gmail.com> --- drivers/usb/renesas_usbhs/mod_gadget.c | 2 +- 1 file changed, 1 insertion

[PATCH -next] usbip: vhci_hcd: fix return value check in add_platform_device()

2016-08-12 Thread Wei Yongjun
In case of error, the function platform_device_register_simple() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyj...@gmail.com> --- drivers/usb/usbip/vhci_hcd.c | 4 ++-- 1 file chan

[PATCH] usb: phy: omap-otg: Fix missing platform_set_drvdata() in omap_otg_probe()

2016-07-26 Thread Wei Yongjun
Add missing platform_set_drvdata() in omap_otg_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun <weiyj...@gmail.com> --- drivers/usb/phy/phy-omap-otg.c | 2 ++ 1 file changed, 2 inse

[PATCH -next] usb: gadget: remove unused variable in gr_queue_int()

2014-01-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The variable 'dev' is initialized but never used otherwise, so remove the unused variable. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/gr_udc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb

[PATCH -next] usb: gadget: s3c-hsotg: remove duplicated include from s3c-hsotg.c

2014-01-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Remove duplicated include. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/s3c-hsotg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index c0ff1cb

[PATCH -next] usb: phy-keystone: remove redundant return value check of platform_get_resource()

2013-12-24 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Remove unneeded error handling on the result of a call to platform_get_resource() when the value is passed to devm_ioremap_resource(). Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/phy/phy-keystone.c | 5 - 1 file

[PATCH -next] staging: dwc2: fix sparse non static symbol warning

2013-11-27 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fixes the following sparse warning: drivers/staging/dwc2/core.c:2672:6: warning: symbol 'dwc2_set_param_uframe_sched' was not declared. Should it be static? Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/staging/dwc2/core.c

[PATCH] usb: phy: phy-generic: fix return value check in usb_nop_xceiv_register()

2013-10-25 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn In case of error, the function platform_device_register_simple() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn

[PATCH -next] usb: phy: omap: remove redundant dev_err call in omap_control_usb_probe()

2013-10-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/phy/phy-omap-control.c | 4 +--- 1 file changed, 1

[PATCH] usbnet: fix error return code in usbnet_probe()

2013-10-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -ENOMEM in the padding pkt alloc fail error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/net/usb/usbnet.c | 4 +++- 1 file changed, 3 insertions

[PATCH] USB: EHCI: tegra: drop clk_put for devm_clk_get in tegra_ehci_probe()

2013-09-27 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn devm_clk_get() is used so there is no reason to explicitly call clk_put() in probe or remove functions. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/host/ehci-tegra.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH -next] USB: WUSBCORE: use list_move_tail instead of list_del/list_add_tail

2013-09-23 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Using list_move_tail() instead of list_del() + list_add_tail(). Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/wusbcore/wa-xfer.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb

[PATCH -next] usb: musb: cppi41: fix missing unlock on error in cppi41_dma_callback()

2013-08-18 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Add the missing unlock before return from function cppi41_dma_callback() in the error handling case. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/musb/musb_cppi41.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH] usb: gadget: f_rndis: fix error return code in rndis_bind()

2013-07-29 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -EINVAL in the vendor param set error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/f_rndis.c | 4 +++- 1 file changed, 3 insertions

[PATCH] usb: gadget: mv_u3d_core: fix to pass correct device identity to free_irq()

2013-07-04 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn free_irq() expects the same device identity that was passed to corresponding request_irq(), otherwise the IRQ is not freed. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/mv_u3d_core.c | 4 ++-- 1 file changed, 2

[PATCH -next] usb: phy: tegra: remove duplicated include from phy-tegra-usb.c

2013-06-19 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Remove duplicated include. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/phy/phy-tegra-usb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index

[PATCH -next] usb: gadget: f_subset: fix missing unlock on error in geth_alloc()

2013-06-17 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Add the missing unlock before return from function geth_alloc() in the error handling case. Introduced by commit 02832e56f88a981474ee4c7c141f46fc1b4454f4. (usb: gadget: f_subset: add configfs support) Signed-off-by: Wei Yongjun yongjun_

[PATCH -next] usb: gadget: f_ncm: fix missing unlock on error in ncm_alloc()

2013-06-17 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Add the missing unlock before return from function ncm_alloc() in the error handling case. Introduced by commit e730660378be92b83288b59b824ccdace5cd2652. (usb: gadget: f_ncm: add configfs support) Signed-off-by: Wei Yongjun yongjun_

[PATCH -next] usb: gadget: f_ecm: fix missing unlock on error in ecm_alloc()

2013-06-17 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Add the missing unlock before return from function ecm_alloc() in the error handling case. Introduced by commit da92801c647cdebfd45001fd6aaecb8f0be7f56b. (usb: gadget: f_ecm: add configfs support) Signed-off-by: Wei Yongjun yongjun_

Re: [PATCH -next] usb: fusbh200-hcd: fix error handling in fusbh200_hcd_fusbh200_probe()

2013-05-31 Thread Wei Yongjun
On 05/31/2013 07:21 PM, gre...@linuxfoundation.org wrote: On Fri, May 31, 2013 at 02:35:41AM +, Wendy Yuan-Hsin Chen(��元馨) wrote: -Original Message- From: Wei Yongjun [mailto:weiyj...@gmail.com] Sent: Tuesday, May 21, 2013 10:41 AM To: gre...@linuxfoundation.org; Wendy Yuan-Hsin

Re: [PATCH -next] usb: fusbh200-hcd: fix error handling in fusbh200_hcd_fusbh200_probe()

2013-05-31 Thread Wei Yongjun
On 05/31/2013 08:29 PM, Greg KH wrote: On Fri, May 31, 2013 at 08:05:22PM +0800, Wei Yongjun wrote: On 05/31/2013 07:21 PM, gre...@linuxfoundation.org wrote: On Fri, May 31, 2013 at 02:35:41AM +, Wendy Yuan-Hsin Chen(??元馨) wrote: -Original Message- From: Wei Yongjun [mailto:weiyj

[PATCH -next] usb: fusbh200-hcd: convert list_for_each to entry variant

2013-05-20 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn convert list_for_each() to list_for_each_entry() where applicable. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/host/fusbh200-hcd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/host

[PATCH -next] usb: fusbh200-hcd: fix error handling in fusbh200_hcd_fusbh200_probe()

2013-05-20 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to release all resources when fusbh200_setup() fail instead of only return error. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/host/fusbh200-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] usb: musb: dsps: fix error return code in dsps_create_musb_pdev()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -ENOMEM in the devm_kzalloc() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/musb/musb_dsps.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] usb: gadget: s3c2410_udc: fix error return code in s3c2410_udc_probe()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code in the gpio_to_irq() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/s3c2410_udc.c | 1 + 1 file changed, 1

[PATCH] usb: gadget: r8a66597-udc: fix error return code in r8a66597_probe()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -ENOMEM in the request alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/r8a66597-udc.c | 4 +++- 1 file changed, 3 insertions

[PATCH] usb: gadget: m66592-udc: fix error return code in m66592_probe()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -ENOMEM in the request alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/m66592-udc.c | 4 +++- 1 file changed, 3 insertions

[PATCH] usb: gadget: fusb300_udc: fix error return code in fusb300_probe()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/fusb300_udc.c | 4 +++- 1 file changed, 3 insertions

[PATCH] usb: gadget: dummy_hcd: fix error return code in init()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -ENOMEM in the kzalloc() error handling case instead of 0(following platform_device_add_data() will overwrite it to 0), as done elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb

[PATCH] usb: gadget: fix error return code in configfs_composite_bind()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code in the go through all configs error handling case instead of 0(usb_add_function() will overwrite ret to 0). Also use error code from usb_gstrings_attach() in all strings init error case instead of -EINVAL. Signed

[PATCH] usb: musb: omap2430: add missing platform_device_put() on error in omap2430_probe()

2013-04-26 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Add the missing platform_device_put() before return from omap2430_probe() in the error handling case. Introduced by commit ca784be36cc725bca9b526eba342de7550329731 (usb: start using the control module driver) Signed-off-by: Wei Yongjun yongjun_

[PATCH -next] usb: gadget: zero: fix error return code in zero_bind()

2013-04-25 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Introduced by commit cf9a08ae5aece88987bbeee8eb0dd0ebb5015815 (usb: gadget: convert source sink and loopback to new function

[PATCH] usbatm: fix potential NULL pointer dereference

2013-04-18 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The dereference to 'instance' in the debug code should be moved below the NULL test. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/atm/usbatm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH -next] staging: dwc2: fix error return code in dwc2_hcd_init()

2013-04-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/staging/dwc2/hcd.c | 1 + 1 file changed, 1 insertion

Re: [PATCH -next] usb: gadget: multi: fix error return code in rndis_do_config()

2013-04-06 Thread Wei Yongjun
On 04/06/2013 01:39 PM, Felipe Balbi wrote: On Sat, Apr 06, 2013 at 12:39:34PM +0800, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei

[PATCH -next v2] usb: gadget: multi: fix error return code in rndis_do_config()

2013-04-06 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Introduced by commit 59835a(usb: gadget: multi: use function framework for ACM.) Signed-off-by: Wei Yongjun yongjun_

[PATCH -next v2] usb: gadget: cdc2: fix error return code in cdc_do_config()

2013-04-06 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Introduced by commit 29a664(usb: gadget: cdc2: use function framework for ACM) Signed-off-by: Wei Yongjun yongjun_

[PATCH -next] usb: gadget: multi: fix error return code in rndis_do_config()

2013-04-05 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/multi.c | 4 +++- 1 file changed, 3 insertions

[PATCH -next] usb: gadget: f_obex: fix error return code in obex_bind()

2013-04-05 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/f_obex.c | 1 + 1 file changed, 1 insertion

[PATCH -next] usb: gadget: cdc2: fix error return code in cdc_do_config()

2013-04-05 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/cdc2.c | 4 +++- 1 file changed, 3 insertions

[PATCH -next] USB: misc: usb3503: use module_i2c_driver to simplify the code

2013-03-11 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Use the module_i2c_driver() macro to make the code smaller and a bit simpler. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/misc/usb3503.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git

[PATCH -next] usb: gadget: tcm_usb_gadge: fix to return error or 0 in tcm_usbg_drop_nexus()

2012-11-13 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn In the error handling case of tcm_usbg_drop_nexus(), the error code is assigned to 'ret', but it is ingored. We'd better return 'ret' instead of always return 0. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch

[PATCH -next v2] usb: gadget: tcm_usb_gadge: fix to return error or 0 in tcm_usbg_drop_nexus()

2012-11-13 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn In the error handling case of tcm_usbg_drop_nexus(), the error code is assigned to 'ret', but it is ignored. We'd better return 'ret' instead of always return 0. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch

[PATCH v2] usb: host: tegra: remove pointless NULL check in tegra_ehci_remove()

2012-11-08 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Test for tegra and hcd in tegra_ehci_remove() look like potential NULL pointer dereference, but in fact those tests are not needed, so remove these pointless tests entirely. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- v1 - v2

[PATCH] usb: host: tegra: fix potential NULL pointer dereference

2012-11-01 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The dereference should be moved below the NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/host/ehci-tegra.c | 8 ++-- 1

[PATCH] usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()

2012-10-23 Thread Wei Yongjun
/ux500.o] Error 2 Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/musb/ux500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index d62a91f..0e62f50 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers

[PATCH] usb: musb: tusb6010: use platform_device_unregister in tusb_remove()

2012-10-22 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn platform_device_unregister() only calls platform_device_del() and platform_device_put(), thus use platform_device_unregister() to simplify the code. Also the documents in platform.c shows that platform_device_del and platform_device_put must _only_

[PATCH] usb: gadget: net2272: fix missing unlock on error in net2272_irq()

2012-10-21 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Add the missing unlock on the error handle path in function net2272_irq(). Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/gadget/net2272.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH] usb: otg: isp1301_omap: fix potential NULL pointer dereference

2012-10-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The dereference should be moved below the NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/otg/isp1301_omap.c | 32

[PATCH] usb: otg: move the dereference below the NULL test

2012-09-09 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/otg/fsl_otg.c | 34

[PATCH] USB: FHCI: use list_move_tail instead of list_del/list_add_tail

2012-09-05 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Using list_move_tail() instead of list_del() + list_add_tail(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/host/fhci-sched.c

[PATCH] USB: cp210x: remove useless set memory to zero use memset()

2012-08-27 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The memory return by kzalloc() or kmem_cache_zalloc() has already be set to zero, so remove useless memset(0). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun yongjun_

usb: cdc-acm: remove duplicated include from cdc-acm.c

2012-08-25 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Remove duplicated include. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/usb/class/cdc-acm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 56d6bf6..9e16f51

[PATCH] USB: mos7720: fix to use list_for_each_entry_safe() when delete items

2012-08-20 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Since we will be removing items off the list using list_del() we need to use a safer version of the list_for_each_entry() macro aptly named list_for_each_entry_safe(). We should use the safe macro if the loop involves deletions of items. Signed-off