[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2B1D156D95AE9B4EAD379CB9E465FE7324AB09DE76@EXDCVYMBSTM005.EQ1STM.local>
Date: Mon, 17 Oct 2011 13:30:06 +0200
From: Robert MARKLUND <robert.marklund@...ricsson.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Steve Glendinning <steve.glendinning@...c.com>,
Mathieu Poirer <mathieu.poirier@...aro.org>
Subject: RE: [PATCH] smsc911x: Add regulator support
> -----Original Message-----
> From: Mark Brown [mailto:broonie@...nsource.wolfsonmicro.com]
> Sent: den 17 oktober 2011 12:53
> To: Robert MARKLUND
> Cc: netdev@...r.kernel.org; Steve Glendinning; Mathieu Poirer
> Subject: Re: [PATCH] smsc911x: Add regulator support
>
> On Mon, Oct 17, 2011 at 08:56:37AM +0200, Robert Marklund wrote:
>
> > + /* Request regulator for vddvario */
> > + if (request && !pdata->regulator_vddvario) {
> > + pdata->regulator_vddvario = regulator_get(&pdev-
> >dev,
> > + "vddvario");
> > + if (IS_ERR(pdata->regulator_vddvario)) {
> > + netdev_warn(ndev,
> > + "%s: Failed to
> get regulator '%s'\n",
> > + __func__,
> "vddvario");
> > + pdata->regulator_vddvario = NULL;
> > + }
>
> No, this is broken - look at how other devices use the regulator API.
> The driver should just request and use the regulators unconditionally
> and let the stubbing and mapping facilities the API has deal with
> ensuring that they always succeed.
[Robert MARKLUND]
So what you mean is get them and use them and ignore all the return codes, and let the FW take care of the error handling ?
>
> As a side note the use of "pdata" as a name for the driver internal
> data
> is really not helpful, pdata is traditionally the platform data passed
> in by the machine (which would be even more broken).
[Robert MARKLUND]
In the driver they have used this name for this structure throughout the file I just followed that.
Personally I think it will be more confusing to change the name of this structure in just this new function.
/R
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists