diff mbox

[1/2] ohci-platform: Change compatible string from usb-ohci to ohci-platform

Message ID 1392127826-31290-2-git-send-email-hdegoede@redhat.com
State Superseded, archived
Headers show

Commit Message

Hans de Goede Feb. 11, 2014, 2:10 p.m. UTC
The initial versions of the devicetree enablement patches for ohci-platform
used "ohci-platform" as compatible string. However this was disliked by various
reviewers because the platform bus is a Linux invention and devicetree is
supposed to be OS agnostic. After much discussion I gave up and went with
the generic usb-ohci as requested.

In retro-spect I should have stuck to my guns, because the dts files for many
existing boards already claim to be compatible with "usb-ohci", ie they have:

	compatible = "ti,ohci-omap3", "usb-ohci";

In theory this should not be a problem since the "ti,ohci-omap3" entry takes
presedence, but in practice using a conflicting compatible string is an issue,
because it makes which driver gets used depent on driver registration order.

This patch changes the compatible string claimed by ohci-platform (back) to
"ohci-platform", avoiding the driver registration / module loading ordering
problems. Note that there already is a precedent for using ?hci-platform, in
the form of xhci-platform.c using "xhci-platfrom" as compatible string.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
 drivers/usb/host/ohci-platform.c                   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Kumar Gala Feb. 11, 2014, 3:06 p.m. UTC | #1
On Feb 11, 2014, at 8:10 AM, Hans De Goede <hdegoede@redhat.com> wrote:

> The initial versions of the devicetree enablement patches for ohci-platform
> used "ohci-platform" as compatible string. However this was disliked by various
> reviewers because the platform bus is a Linux invention and devicetree is
> supposed to be OS agnostic. After much discussion I gave up and went with
> the generic usb-ohci as requested.
> 
> In retro-spect I should have stuck to my guns, because the dts files for many
> existing boards already claim to be compatible with "usb-ohci", ie they have:
> 
> 	compatible = "ti,ohci-omap3", "usb-ohci";
> 
> In theory this should not be a problem since the "ti,ohci-omap3" entry takes
> presedence, but in practice using a conflicting compatible string is an issue,
> because it makes which driver gets used depent on driver registration order.
> 
> This patch changes the compatible string claimed by ohci-platform (back) to
> "ohci-platform", avoiding the driver registration / module loading ordering
> problems. Note that there already is a precedent for using ?hci-platform, in
> the form of xhci-platform.c using "xhci-platfrom" as compatible string.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
> drivers/usb/host/ohci-platform.c                   | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
> index 6933b0c..a8e576a 100644
> --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
> @@ -1,7 +1,7 @@
> USB OHCI controllers
> 
> Required properties:
> -- compatible : "usb-ohci”

Why not leave ‘usb-ohci’ and deprecate it?

> +- compatible : "ohci-platform"
> - reg : ohci controller register range (address and length)
> - interrupts : ohci controller interrupt
> 
> @@ -16,7 +16,7 @@ Optional properties:
> Example:
> 
> 	ohci0: usb@01c14400 {
> -		compatible = "allwinner,sun4i-a10-ohci", "usb-ohci";
> +		compatible = "allwinner,sun4i-a10-ohci", "ohci-platform";
> 		reg = <0x01c14400 0x100>;
> 		interrupts = <64>;
> 		clocks = <&usb_clk 6>, <&ahb_gates 2>;
> diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
> index e2c28fd..59f3551 100644
> --- a/drivers/usb/host/ohci-platform.c
> +++ b/drivers/usb/host/ohci-platform.c
> @@ -319,7 +319,7 @@ static int ohci_platform_resume(struct device *dev)
> #endif /* CONFIG_PM */
> 
> static const struct of_device_id ohci_platform_ids[] = {
> -	{ .compatible = "usb-ohci", },
> +	{ .compatible = "ohci-platform", },
> 	{ }
> };
> MODULE_DEVICE_TABLE(of, ohci_platform_ids);
> -- 
> 1.8.5.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hans de Goede Feb. 11, 2014, 3:21 p.m. UTC | #2
Hi,

On 02/11/2014 04:06 PM, Kumar Gala wrote:
> 
> On Feb 11, 2014, at 8:10 AM, Hans De Goede <hdegoede@redhat.com> wrote:
> 
>> The initial versions of the devicetree enablement patches for ohci-platform
>> used "ohci-platform" as compatible string. However this was disliked by various
>> reviewers because the platform bus is a Linux invention and devicetree is
>> supposed to be OS agnostic. After much discussion I gave up and went with
>> the generic usb-ohci as requested.
>>
>> In retro-spect I should have stuck to my guns, because the dts files for many
>> existing boards already claim to be compatible with "usb-ohci", ie they have:
>>
>> 	compatible = "ti,ohci-omap3", "usb-ohci";
>>
>> In theory this should not be a problem since the "ti,ohci-omap3" entry takes
>> presedence, but in practice using a conflicting compatible string is an issue,
>> because it makes which driver gets used depent on driver registration order.
>>
>> This patch changes the compatible string claimed by ohci-platform (back) to
>> "ohci-platform", avoiding the driver registration / module loading ordering
>> problems. Note that there already is a precedent for using ?hci-platform, in
>> the form of xhci-platform.c using "xhci-platfrom" as compatible string.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
>> drivers/usb/host/ohci-platform.c                   | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> index 6933b0c..a8e576a 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> @@ -1,7 +1,7 @@
>> USB OHCI controllers
>>
>> Required properties:
>> -- compatible : "usb-ohci”
> 
> Why not leave ‘usb-ohci’ and deprecate it?

As it was introduced just a couple of days ago in linux-next, and has never seen
the light in any released kernel.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gala Feb. 11, 2014, 3:34 p.m. UTC | #3
On Feb 11, 2014, at 9:21 AM, Hans de Goede <hdegoede@redhat.com> wrote:

> Hi,
> 
> On 02/11/2014 04:06 PM, Kumar Gala wrote:
>> 
>> On Feb 11, 2014, at 8:10 AM, Hans De Goede <hdegoede@redhat.com> wrote:
>> 
>>> The initial versions of the devicetree enablement patches for ohci-platform
>>> used "ohci-platform" as compatible string. However this was disliked by various
>>> reviewers because the platform bus is a Linux invention and devicetree is
>>> supposed to be OS agnostic. After much discussion I gave up and went with
>>> the generic usb-ohci as requested.
>>> 
>>> In retro-spect I should have stuck to my guns, because the dts files for many
>>> existing boards already claim to be compatible with "usb-ohci", ie they have:
>>> 
>>> 	compatible = "ti,ohci-omap3", "usb-ohci";
>>> 
>>> In theory this should not be a problem since the "ti,ohci-omap3" entry takes
>>> presedence, but in practice using a conflicting compatible string is an issue,
>>> because it makes which driver gets used depent on driver registration order.
>>> 
>>> This patch changes the compatible string claimed by ohci-platform (back) to
>>> "ohci-platform", avoiding the driver registration / module loading ordering
>>> problems. Note that there already is a precedent for using ?hci-platform, in
>>> the form of xhci-platform.c using "xhci-platfrom" as compatible string.
>>> 
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>> ---
>>> Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
>>> drivers/usb/host/ohci-platform.c                   | 2 +-
>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>>> index 6933b0c..a8e576a 100644
>>> --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
>>> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>>> @@ -1,7 +1,7 @@
>>> USB OHCI controllers
>>> 
>>> Required properties:
>>> -- compatible : "usb-ohci”
>> 
>> Why not leave ‘usb-ohci’ and deprecate it?
> 
> As it was introduced just a couple of days ago in linux-next, and has never seen
> the light in any released kernel.

ah, never mind :)

- k
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
index 6933b0c..a8e576a 100644
--- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
@@ -1,7 +1,7 @@ 
 USB OHCI controllers
 
 Required properties:
-- compatible : "usb-ohci"
+- compatible : "ohci-platform"
 - reg : ohci controller register range (address and length)
 - interrupts : ohci controller interrupt
 
@@ -16,7 +16,7 @@  Optional properties:
 Example:
 
 	ohci0: usb@01c14400 {
-		compatible = "allwinner,sun4i-a10-ohci", "usb-ohci";
+		compatible = "allwinner,sun4i-a10-ohci", "ohci-platform";
 		reg = <0x01c14400 0x100>;
 		interrupts = <64>;
 		clocks = <&usb_clk 6>, <&ahb_gates 2>;
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index e2c28fd..59f3551 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -319,7 +319,7 @@  static int ohci_platform_resume(struct device *dev)
 #endif /* CONFIG_PM */
 
 static const struct of_device_id ohci_platform_ids[] = {
-	{ .compatible = "usb-ohci", },
+	{ .compatible = "ohci-platform", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ohci_platform_ids);