sunxi: driver refresh for 3.13
[openwrt.git] / target / linux / sunxi / patches-3.13 / 180-5-usb-ohci-change-compat-string.patch
1 From abddd82743cc2c4acdfe66a6d5e63f2085d2269b Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Tue, 11 Feb 2014 11:27:29 +0100
4 Subject: [PATCH] ohci-platform: Change compatible string from usb-ohci to
5  generic-ohci
6
7 The initial versions of the devicetree enablement patches for ohci-platform
8 used "ohci-platform" as compatible string. However this was disliked by various
9 reviewers because the platform bus is a Linux invention and devicetree is
10 supposed to be OS agnostic. After much discussion I gave up and went with
11 the generic usb-ohci as requested.
12
13 In retro-spect I should have chosen something different, the dts files for many
14 existing boards already claim to be compatible with "usb-ohci", ie they have:
15
16         compatible = "ti,ohci-omap3", "usb-ohci";
17
18 In theory this should not be a problem since the "ti,ohci-omap3" entry takes
19 presedence, but in practice using a conflicting compatible string is an issue,
20 because it makes which driver gets used depend on driver registration order.
21
22 This patch changes the compatible string claimed by ohci-platform to
23 "generic-ohci", avoiding the driver registration / module loading ordering
24 problems.
25
26 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
27 ---
28  Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
29  drivers/usb/host/ohci-platform.c                   | 2 +-
30  2 files changed, 3 insertions(+), 3 deletions(-)
31
32 diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
33 index 6933b0c..45f67d9 100644
34 --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
35 +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
36 @@ -1,7 +1,7 @@
37  USB OHCI controllers
38  
39  Required properties:
40 -- compatible : "usb-ohci"
41 +- compatible : "generic-ohci"
42  - reg : ohci controller register range (address and length)
43  - interrupts : ohci controller interrupt
44  
45 @@ -16,7 +16,7 @@ Optional properties:
46  Example:
47  
48         ohci0: usb@01c14400 {
49 -               compatible = "allwinner,sun4i-a10-ohci", "usb-ohci";
50 +               compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
51                 reg = <0x01c14400 0x100>;
52                 interrupts = <64>;
53                 clocks = <&usb_clk 6>, <&ahb_gates 2>;
54 diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
55 index e2c28fd..b6ca0b2 100644
56 --- a/drivers/usb/host/ohci-platform.c
57 +++ b/drivers/usb/host/ohci-platform.c
58 @@ -319,7 +319,7 @@ static int ohci_platform_resume(struct device *dev)
59  #endif /* CONFIG_PM */
60  
61  static const struct of_device_id ohci_platform_ids[] = {
62 -       { .compatible = "usb-ohci", },
63 +       { .compatible = "generic-ohci", },
64         { }
65  };
66  MODULE_DEVICE_TABLE(of, ohci_platform_ids);
67 -- 
68 1.8.5.5
69