Skip to content
  1. Aug 25, 2014
    • Julia Lawall's avatar
      pwm: lpss: use c99 initializers in structures · b2b7adeb
      Julia Lawall authored
      
      
      Use c99 initializers for structures.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @decl@
      identifier i1,fld;
      type T;
      field list[n] fs;
      @@
      
      struct i1 {
       fs
       T fld;
       ...};
      
      @bad@
      identifier decl.i1,i2;
      expression e;
      initializer list[decl.n] is;
      @@
      
      struct i1 i2 = { is,
      + .fld = e
      - e
       ,...};
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      [thierry.reding: rebased and applied same fix for Braswell]
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      b2b7adeb
  2. Aug 23, 2014
  3. Aug 22, 2014
  4. Aug 20, 2014
  5. Aug 18, 2014
    • Geert Uytterhoeven's avatar
      pwm: Fix period and polarity in pwm_get() for non-perfect matches · d717ea73
      Geert Uytterhoeven authored
      If pwm_get() finds a look-up entry with a perfect match (both dev_id and
      con_id match), the loop is aborted, and "p" still points to the correct
      struct pwm_lookup.
      
      If only an entry with a matching dev_id or con_id is found, the loop
      terminates after traversing the whole list, and "p" now points to
      arbitrary memory, not part of the pwm_lookup list.
      Then pwm_set_period() and pwm_set_polarity() will set random values for
      period resp. polarity.
      
      To fix this, save period and polarity when finding a new best match,
      just like is done for chip (for the provider) and index.
      
      This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed
      period 0 and polarity -1068821144 instead of 33333 resp. 1.
      
      Fixes: 3796ce1d
      
       ("pwm: add period and polarity to struct pwm_lookup")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      d717ea73
  6. Aug 17, 2014
  7. Aug 16, 2014