netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Grzeschik <mgr@pengutronix.de>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-can@vger.kernel.org, mkl@pengutronix.de,
	kernel@pengutronix.de, wg@grandegger.com
Subject: Re: [PATCH v2] can: c_can: add xceiver enable/disable support
Date: Wed, 20 Jan 2016 17:46:40 +0100	[thread overview]
Message-ID: <20160120164640.GC14234@pengutronix.de> (raw)
In-Reply-To: <87k2n4fcl5.fsf@nemi.mork.no>

Hi,

On Wed, Jan 20, 2016 at 05:19:18PM +0100, Bjørn Mork wrote:
> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
> 
> > @@ -1263,6 +1271,10 @@ int register_c_can_dev(struct net_device *dev)
> >  	 */
> >  	pinctrl_pm_select_sleep_state(dev->dev.parent);
> >  
> > +	priv->reg_xceiver = devm_regulator_get(priv->device, "xceiver");
> > +	if (IS_ERR(priv->reg_xceiver))
> > +		return PTR_ERR(priv->reg_xceiver);
> > +
> >  	c_can_pm_runtime_enable(priv);
> >  
> >  	dev->flags |= IFF_ECHO;	/* we support local echo */
> 
> Do you really want to leave priv->reg_xceiver pointing to an ERR_PTR in
> case of error?

No, therefore the priv->reg_xceiver will be returned in case of error.
This codepath is called once on device registration.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2016-01-20 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 13:44 [PATCH v2] can: c_can: add xceiver enable/disable support Michael Grzeschik
2016-01-20 14:01 ` Markus Pargmann
2016-01-20 14:11 ` Kurt Van Dijck
2016-01-20 14:29   ` Marc Kleine-Budde
2016-01-20 14:29   ` Markus Pargmann
2016-01-20 16:19 ` Bjørn Mork
2016-01-20 16:46   ` Michael Grzeschik [this message]

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=20160120164640.GC14234@pengutronix.de \
    --to=mgr@pengutronix.de \
    --cc=bjorn@mork.no \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=wg@grandegger.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).