netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: Viresh Kumar <viresh.kumar@st.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree-discuss@ozlabs.org" <devicetree-discuss@ozlabs.org>,
	"spear-devel" <spear-devel@list.st.com>,
	Peppe CAVALLARO <peppe.cavallaro@st.com>
Subject: Re: [PATCH v2] stmmac: Add device-tree support
Date: Tue, 13 Mar 2012 11:29:34 +0100	[thread overview]
Message-ID: <201203131129.34449.sr@denx.de> (raw)
In-Reply-To: <4F5F0AF2.1070508@st.com>

On Tuesday 13 March 2012 09:53:06 Viresh Kumar wrote:
> On 3/13/2012 12:53 PM, Stefan Roese wrote:
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > 
> > +#ifdef CONFIG_OF
> > +static int __devinit stmmac_probe_config_dt(struct platform_device
> > *pdev, +					    struct 
plat_stmmacenet_data *plat,
> > +					    const char **mac)
> > +{
> 
> <snip...>
> 
> > +}
> > +#else
> > +static int __devinit stmmac_probe_config_dt(struct platform_device
> > *pdev, +					    struct 
plat_stmmacenet_data *plat,
> > +					    const char **mac)
> > +{
> > +	return ERR_PTR(-ENOSYS);
> 
> why ERR_PTR()?

Thanks for spotting. Will fix in next version.
 
> > +}
> > +#endif /* CONFIG_OF */
> > +
> > 
> >  /**
> >  
> >   * stmmac_pltfr_probe
> >   * @pdev: platform device pointer
> > 
> > @@ -58,7 +101,25 @@ static int stmmac_pltfr_probe(struct platform_device
> > *pdev)
> > 
> >  		ret = -ENOMEM;
> >  		goto out_release_region;
> >  	
> >  	}
> > 
> > -	plat_dat = pdev->dev.platform_data;
> > +
> > +	if (pdev->dev.of_node) {
> > +		plat_dat = devm_kzalloc(&pdev->dev,
> > +					sizeof(struct 
plat_stmmacenet_data),
> > +					GFP_KERNEL);
> > +		if (!plat_dat) {
> > +			pr_err("%s: ERROR: no memory", __func__);
> 
> why don't we use dev_err here?

Consistency. pr_err is used in this driver. So I'm sticking to it with this 
patch as well.
 
Thanks,
Stefan

  reply	other threads:[~2012-03-13 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  7:23 [PATCH v2] stmmac: Add device-tree support Stefan Roese
2012-03-13  8:53 ` Viresh Kumar
2012-03-13 10:29   ` Stefan Roese [this message]
2012-03-13 11:11     ` Viresh Kumar
2012-03-13 11:40       ` Stefan Roese
2012-03-13 11:43         ` Viresh Kumar
     [not found] ` <1331623394-14600-1-git-send-email-sr-ynQEQJNshbs@public.gmane.org>
2012-03-13 14:18   ` Rob Herring
2012-03-13 14:28     ` Stefan Roese

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=201203131129.34449.sr@denx.de \
    --to=sr@denx.de \
    --cc=devicetree-discuss@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=spear-devel@list.st.com \
    --cc=viresh.kumar@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).