[PATCH 3/4] cpufreq: imx6q: Fix regulator/clock error handling

Sascha Hauer s.hauer at pengutronix.de
Mon Oct 26 00:38:35 PDT 2015


On Thu, Oct 22, 2015 at 07:03:15PM +0530, Viresh Kumar wrote:
> On 22-10-15, 10:47, Sascha Hauer wrote:
> > +	arm_reg = regulator_get(cpu_dev, "arm");
> > +	if (IS_ERR(arm_reg))
> > +		return PTR_ERR(arm_reg);
> > +
> > +	pu_reg = regulator_get_optional(cpu_dev, "pu");
> 
> Yes, current code doesn't care about if this failed, but if that's the
> intention please add a comment for it now.

This is fixed right in the next patch.

> 
> > +	soc_reg = regulator_get(cpu_dev, "soc");
> > +	if (IS_ERR(soc_reg))
> > +		return PTR_ERR(soc_reg);
> > +
> > +	return 0;
> > +}
> > +
> > +
> > +static void imx6q_cpufreq_put_resources(void)
> > +{
> > +	if (!IS_ERR_OR_NULL(arm_reg))
> > +		regulator_put(arm_reg);
> > +	arm_reg = NULL;
> 
> Can you please clarify (maybe again) why this is required to be set to
> NULL again?

Ok.

Sascha

-- 
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 |



More information about the linux-arm-kernel mailing list