devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
Cc: netdev@vger.kernel.org, Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 1/3] dt:net:stmmac: Allocate platform data only if its NULL.
Date: Mon, 01 Jul 2013 19:20:22 +0200	[thread overview]
Message-ID: <51D1BA56.1000001@st.com> (raw)
In-Reply-To: <1372679024-13089-1-git-send-email-srinivas.kandagatla@st.com>

On 7/1/2013 1:43 PM, Srinivas KANDAGATLA wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> In some DT use-cases platform data might be already allocated and passed
> via AUXDATA. These are the cases where machine level code populates few
> callbacks in the platform data.
>
> This patch adds check and reuses platform_data if its valid, before
> allocating a new one.

Ye, we had seen this long time ago and IIRC i prepared the patch
so

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> ---
>   .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 1d3780f..5907920 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -92,8 +92,10 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
>   	if (IS_ERR(addr))
>   		return PTR_ERR(addr);
>
> +	plat_dat = pdev->dev.platform_data;
>   	if (pdev->dev.of_node) {
> -		plat_dat = devm_kzalloc(&pdev->dev,
> +		if (!plat_dat)
> +			plat_dat = devm_kzalloc(&pdev->dev,
>   					sizeof(struct plat_stmmacenet_data),
>   					GFP_KERNEL);
>   		if (!plat_dat) {
> @@ -106,8 +108,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
>   			pr_err("%s: main dt probe failed", __func__);
>   			return ret;
>   		}
> -	} else {
> -		plat_dat = pdev->dev.platform_data;
>   	}
>
>   	/* Custom initialisation (if needed)*/
>

  reply	other threads:[~2013-07-01 17:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01 11:42 [PATCH RFC 0/3] extend stmmac DT support Srinivas KANDAGATLA
2013-07-01 11:43 ` [PATCH RFC 1/3] dt:net:stmmac: Allocate platform data only if its NULL Srinivas KANDAGATLA
2013-07-01 17:20   ` Giuseppe CAVALLARO [this message]
2013-07-01 17:20   ` Giuseppe CAVALLARO
2013-07-01 11:43 ` [PATCH RFC 2/3] dt:net:stmmac: Add support to dwmac version 3.610 and 3.710 Srinivas KANDAGATLA
2013-07-01 17:20   ` Giuseppe CAVALLARO
2013-07-02  6:42     ` Srinivas KANDAGATLA
     [not found]       ` <51D27658.1060806-qxv4g6HH51o@public.gmane.org>
2013-07-02  8:04         ` Giuseppe CAVALLARO
2013-07-01 11:44 ` [PATCH RFC 3/3] dt:net:stmmac: Add dt specific phy reset callback support Srinivas KANDAGATLA

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=51D1BA56.1000001@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=srinivas.kandagatla@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;
as well as URLs for NNTP newsgroup(s).