Re: [PATCH] backlight: add regulator support for platform_lcd driver

From: Thomas Abraham
Date: Mon Dec 05 2011 - 04:14:17 EST


Hi Felipe,

On 5 December 2011 14:22, Felipe Balbi <balbi@xxxxxx> wrote:

[...]

>> +     if (lcd_power) {
>> +             if (plcd->pdata->min_uV || plcd->pdata->max_uV)
>> +                     if (regulator_set_voltage(lcd_regulator,
>> +                             plcd->pdata->min_uV, plcd->pdata->max_uV))
>> +                             dev_info(plcd->us,
>> +                                     "regulator voltage set failed\n");
>> +
>> +             if (regulator_enable(lcd_regulator))
>> +                     dev_info(plcd->us, "failed to enable regulator\n");
>> +     } else {
>> +             regulator_disable(lcd_regulator);
>> +     }
>> +
>> +     regulator_put(lcd_regulator);
>
> I wonder why you ->get() and ->put() everytime here. Wouldn't it be
> enough to ->get() on probe() and ->put() on remove() ??

Thanks for the suggestion. It would be simpler if done in probe. I
will redo this patch.

Regards,
Thomas.

>
> --
> balbi
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/