On Tue, Oct 07, 2014 at 03:55:33PM +0200, Lothar Waßmann wrote: > Change the pwm chip driver registration, so that a chip driver that > supports polarity inversion can still be used with DTBs that don't > provide the 'PWM_POLARITY' flag. > > This is done to provide polarity inversion support for the pwm-imx > driver without having to modify all existing DTS files. I don't like how this throws out the window the only sanity checking we have in place for the #pwm-cells property. As I understand it, the problem that you're trying to solve is one of backwards-compatibility where existing device trees have #pwm-cells = <2>, but the driver is extended to support flags as well. In that case, can we not simply make of_pwm_xlate_with_flags() support that case transparently? That is, if the driver sets .of_pwm_n_cells to 3, we can still support #pwm-cells = <2> and use the default (no) flags instead. Something like the below should do that (compile-tested only). Thierry