Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565732 > unrolled thread

[PATCH v4] net: ethernet: faraday: To support device tree usage.

Started byGreentime Hu <green.hu@gmail.com>
First post2017-01-24 10:10 +0100
Last post2017-01-28 01:10 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v4] net: ethernet: faraday: To support device tree usage. Greentime Hu <green.hu@gmail.com> - 2017-01-24 10:10 +0100
    Re: [PATCH v4] net: ethernet: faraday: To support device tree  usage. David Miller <davem@davemloft.net> - 2017-01-25 18:40 +0100
      Re: [PATCH v4] net: ethernet: faraday: To support device tree usage. Arnd Bergmann <arnd@arndb.de> - 2017-01-25 22:20 +0100
        Re: [PATCH v4] net: ethernet: faraday: To support device tree usage. Rob Herring <robh@kernel.org> - 2017-01-28 01:10 +0100

#1565732 — [PATCH v4] net: ethernet: faraday: To support device tree usage.

FromGreentime Hu <green.hu@gmail.com>
Date2017-01-24 10:10 +0100
Subject[PATCH v4] net: ethernet: faraday: To support device tree usage.
Message-ID<t35gZ-2ns-9@gated-at.bofh.it>
We also use the same binding document to describe the same faraday ethernet
controller and add faraday to vendor-prefixes.txt.

Signed-off-by: Greentime Hu <green.hu@gmail.com>
---
Changes in v4:
  - Use the same binding document to describe the same faraday ethernet controller and add faraday to vendor-prefixes.txt.
Changes in v3:
  - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.
Changes in v2:
  - Change atmac100_of_ids to ftmac100_of_ids

---
 .../net/{moxa,moxart-mac.txt => faraday,ftmac.txt} |    7 +++++--
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 drivers/net/ethernet/faraday/ftmac100.c            |    7 +++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
 rename Documentation/devicetree/bindings/net/{moxa,moxart-mac.txt => faraday,ftmac.txt} (68%)

diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
similarity index 68%
rename from Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
rename to Documentation/devicetree/bindings/net/faraday,ftmac.txt
index 583418b..be4f55e 100644
--- a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
+++ b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
@@ -1,8 +1,11 @@
-MOXA ART Ethernet Controller
+Faraday Ethernet Controller
 
 Required properties:
 
-- compatible : Must be "moxa,moxart-mac"
+- compatible : Must contain "faraday,ftmac", as well as one of
+		the SoC specific identifiers:
+		"andestech,atmac100"
+		"moxa,moxart-mac"
 - reg : Should contain register location and length
 - interrupts : Should contain the mac interrupt number
 
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 16d3b5e..489c336 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -102,6 +102,7 @@ everest	Everest Semiconductor Co. Ltd.
 everspin	Everspin Technologies, Inc.
 excito	Excito
 ezchip	EZchip Semiconductor
+faraday	Faraday Technology Corporation
 fcs	Fairchild Semiconductor
 firefly	Firefly
 focaltech	FocalTech Systems Co.,Ltd
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index dce5f7b..5d70ee9 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1172,11 +1172,17 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ftmac100_of_ids[] = {
+	{ .compatible = "andestech,atmac100" },
+	{ }
+};
+
 static struct platform_driver ftmac100_driver = {
 	.probe		= ftmac100_probe,
 	.remove		= __exit_p(ftmac100_remove),
 	.driver		= {
 		.name	= DRV_NAME,
+		.of_match_table = ftmac100_of_ids
 	},
 };
 
@@ -1200,3 +1206,4 @@ static void __exit ftmac100_exit(void)
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTMAC100 driver");
 MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(of, ftmac100_of_ids);
-- 
1.7.9.5

[toc] | [next] | [standalone]


#1566783 — Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.

FromDavid Miller <davem@davemloft.net>
Date2017-01-25 18:40 +0100
SubjectRe: [PATCH v4] net: ethernet: faraday: To support device tree usage.
Message-ID<t3zI7-4Hf-35@gated-at.bofh.it>
In reply to#1565732
From: Greentime Hu <green.hu@gmail.com>
Date: Tue, 24 Jan 2017 16:46:14 +0800

> We also use the same binding document to describe the same faraday ethernet
> controller and add faraday to vendor-prefixes.txt.
> 
> Signed-off-by: Greentime Hu <green.hu@gmail.com>
> ---
> Changes in v4:
>   - Use the same binding document to describe the same faraday ethernet controller and add faraday to vendor-prefixes.txt.
> Changes in v3:
>   - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.
> Changes in v2:
>   - Change atmac100_of_ids to ftmac100_of_ids
> 
> ---
>  .../net/{moxa,moxart-mac.txt => faraday,ftmac.txt} |    7 +++++--
>  .../devicetree/bindings/vendor-prefixes.txt        |    1 +
>  drivers/net/ethernet/faraday/ftmac100.c            |    7 +++++++
>  3 files changed, 13 insertions(+), 2 deletions(-)
>  rename Documentation/devicetree/bindings/net/{moxa,moxart-mac.txt => faraday,ftmac.txt} (68%)
> 
> diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
> similarity index 68%
> rename from Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
> rename to Documentation/devicetree/bindings/net/faraday,ftmac.txt

Why are you renaming the MOXA binding file instead of adding a completely new one
for faraday?  The MOXA one should stick around, I don't see a justification for
removing it.

[toc] | [prev] | [next] | [standalone]


#1566957

FromArnd Bergmann <arnd@arndb.de>
Date2017-01-25 22:20 +0100
Message-ID<t3D90-730-15@gated-at.bofh.it>
In reply to#1566783
On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
> From: Greentime Hu <green.hu@gmail.com>
> Date: Tue, 24 Jan 2017 16:46:14 +0800
>> We also use the same binding document to describe the same faraday ethernet
>> controller and add faraday to vendor-prefixes.txt.
>
> Why are you renaming the MOXA binding file instead of adding a completely new one
> for faraday?  The MOXA one should stick around, I don't see a justification for
> removing it.

This was my suggestion, basically fixing the name of the existing
binding, which was
accidentally named after one of the users rather than the company that did the
hardware.

We can't change the compatible string, but I'd much prefer having only
one binding
file for this device rather than two separate ones that could possibly become
incompatible in case we add new properties to them. If there is only
one of them,
naming it according to the hardware design is the general policy.

Note that we currently have two separate device drivers, but that is more a
historic artifact, and if we ever get around to merging them into one driver,
that should not impact the binding.

    Arnd

[toc] | [prev] | [next] | [standalone]


#1568791

FromRob Herring <robh@kernel.org>
Date2017-01-28 01:10 +0100
Message-ID<t4oKC-2wK-17@gated-at.bofh.it>
In reply to#1566957
On Wed, Jan 25, 2017 at 10:09:20PM +0100, Arnd Bergmann wrote:
> On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
> > From: Greentime Hu <green.hu@gmail.com>
> > Date: Tue, 24 Jan 2017 16:46:14 +0800
> >> We also use the same binding document to describe the same faraday ethernet
> >> controller and add faraday to vendor-prefixes.txt.
> >
> > Why are you renaming the MOXA binding file instead of adding a completely new one
> > for faraday?  The MOXA one should stick around, I don't see a justification for
> > removing it.
> 
> This was my suggestion, basically fixing the name of the existing
> binding, which was
> accidentally named after one of the users rather than the company that did the
> hardware.
> 
> We can't change the compatible string, but I'd much prefer having only
> one binding
> file for this device rather than two separate ones that could possibly become
> incompatible in case we add new properties to them. If there is only
> one of them,
> naming it according to the hardware design is the general policy.
> 
> Note that we currently have two separate device drivers, but that is more a
> historic artifact, and if we ever get around to merging them into one driver,
> that should not impact the binding.

The change is fine with me, but the subject and commit message need some 
work. I'm guessing faraday licensed this to MOXA or something? Why is 
the new name preferred or better?

Rob

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web