2aeadc30eda45c188be25209b20780ad5f5fb6a9
[openwrt/staging/yousong.git] / target / linux / ipq806x / patches-4.4 / 097-4-usb-dwc3-fix-missing-platform_set_drvdata-in-dwc3_of_simple_probe.patch
1 From 4c4f106c032ff32b89c98a4d819e68e6e643c14e Mon Sep 17 00:00:00 2001
2 From: Wei Yongjun <weiyj.lk@gmail.com>
3 Date: Tue, 26 Jul 2016 14:47:00 +0000
4 Subject: usb: dwc3: fix missing platform_set_drvdata() in
5 dwc3_of_simple_probe()
6
7 Add missing platform_set_drvdata() in dwc3_of_simple_probe(), otherwise
8 calling platform_get_drvdata() in remove returns NULL.
9
10 This is detected by Coccinelle semantic patch.
11
12 Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
13 Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
14 ---
15 drivers/usb/dwc3/dwc3-of-simple.c | 1 +
16 1 file changed, 1 insertion(+)
17
18 diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
19 index 9743353..e56d59b 100644
20 --- a/drivers/usb/dwc3/dwc3-of-simple.c
21 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
22 @@ -61,6 +61,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
23 if (!simple->clks)
24 return -ENOMEM;
25
26 + platform_set_drvdata(pdev, simple);
27 simple->dev = dev;
28
29 for (i = 0; i < simple->num_clocks; i++) {
30 --
31 cgit v0.12