Netdev List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: peppe.cavallaro@st.com, Joachim Eastwood <manabian@gmail.com>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] stmac: add dwmac glue for NXP 18xx/43xx family
Date: Sat, 02 May 2015 21:31:04 +0200	[thread overview]
Message-ID: <3200125.o3jqXuyPfG@wuerfel> (raw)
In-Reply-To: <1430584842-23408-2-git-send-email-manabian@gmail.com>

On Saturday 02 May 2015 18:40:41 Joachim Eastwood wrote:
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -36,6 +36,7 @@ static const struct of_device_id stmmac_dt_ids[] = {
>         { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_gmac_data},
>         { .compatible = "amlogic,meson6-dwmac", .data = &meson6_dwmac_data},
>         { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
> +       { .compatible = "nxp,lpc1850-dwmac", .data = &lpc18xx_dwmac_data},
>         { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
>         { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
>         { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
> 

Any chance you could turn this around and do the probing in the normal
order, with a platform driver that registers to your compatible string
and calls into a common base module?

Unfortunately, something went wrong when we first started adding platform
specific hacks to the driver. I tried to fix it up back then, and IIRC
it was agreed that it should be changed but my patches for some reason
missed out on getting merged and the mistake propagated afterwards.

It should be fairly straightforward to split the probe function
into two and export a function that takes a device and a stmmac_of_data
pointer as arguments, and declare a module_platform_driver in your
code.

	Arnd

  reply	other threads:[~2015-05-02 19:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 16:40 [PATCH 0/2] stmac: add glue for NXP LPC18xx family Joachim Eastwood
2015-05-02 16:40 ` [PATCH 1/2] stmac: add dwmac glue for NXP 18xx/43xx family Joachim Eastwood
2015-05-02 19:31   ` Arnd Bergmann [this message]
2015-05-02 20:48     ` Joachim Eastwood
2015-05-03 22:14     ` Joachim Eastwood
2015-05-04 18:46       ` Arnd Bergmann
2015-05-04 19:27         ` Joachim Eastwood
2015-05-02 16:40 ` [PATCH 2/2] doc: dt: add documentation for nxp,lpc1850-dwmac Joachim Eastwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3200125.o3jqXuyPfG@wuerfel \
    --to=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=manabian@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox