[PATCH] ARM amba: optional PrimeCell core voltage switch
Russell King - ARM Linux
linux at arm.linux.org.uk
Wed Nov 3 11:05:50 EDT 2010
On Wed, Nov 03, 2010 at 07:41:44PM +0530, Sundar wrote:
> On Wed, Nov 3, 2010 at 3:39 PM, Linus Walleij
> <linus.walleij at stericsson.com> wrote:
> >
> > +static int amba_get_enable_vcore(struct amba_device *pcdev)
> > +{
> > + struct regulator *vcore = regulator_get(&pcdev->dev, "vcore");
> > + int ret;
> > +
> > + pcdev->vcore = vcore;
> > +
> > + if (IS_ERR(vcore)) {
> > + /* It is OK not to supply a vcore regulator */
> > + if (PTR_ERR(vcore) == -ENODEV)
> > + return 0;
> > + return PTR_ERR(vcore);
> > + }
>
> If i am right, you corrupt the pcdev->vcore even in an error case.
So? It's previous value is meaningless, and on failure the amba device
is not registered, and so this value won't be used.
More information about the linux-arm-kernel
mailing list