[PATCH v3 1/4] leds: leds-pwm: Convert to use devm_get_pwm

Thierry Reding thierry.reding at avionic-design.de
Tue Dec 11 20:31:00 EST 2012


On Tue, Dec 11, 2012 at 09:57:51AM +0100, Peter Ujfalusi wrote:
> On Tuesday 11 December 2012 09:36:35 Thierry Reding wrote:
> > > > The commit message says that legacy mode is used as fallback if
> > > > devm_get_pwm() (that should really be devm_pwm_get() btw) fails but I
> > > > don't see where pwm_request() is called.
> > > 
> > > Oh, true. The fallback has been removed based on earlier comment from
> > > Bryan
> > > Wu. I will correct the commit message.
> > 
> > I'm not so sure that's a good idea. After all there may still be users
> > who rely on the legacy behaviour.
> 
> The only user of leds_pwm is arch/arm/mach-omap2/board-4430sdp.c. Even that is 
> not working because it uses wrong ID number to request the pwm.
> The legacy request type needs the id number of the PWM it want to use. But if 
> you have multiple PWM devices there is not way to guess the ID for the PWM. 
> Using the pwm_get() along with pwm_lookup is the only way to get thing 
> working.
> For example with twl4030 we have 2 PWM chips, both provides 2 PWMs. The ID 
> number of the PWMs will depend on the load order of the drivers. If they are 
> built in they are going to be in the same order most of the time, but if they 
> are modules they can be loaded in different order.
> 
> I think we should not use fallback in leds-pwm to avoid new boards to use the 
> legacy API.

Okay, if there are no intree users that may be broken, then it should be
fine to remove it. In that case you might want to remove the pwm_id
field as well instead of deprecating it in this patch.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20121211/a3720554/attachment.sig>


More information about the devicetree-discuss mailing list