Skip to content
  1. Oct 20, 2014
  2. Sep 25, 2014
  3. Aug 29, 2014
    • Geert Uytterhoeven's avatar
      pwm: Fix uninitialized warnings in pwm_get() · 70145f87
      Geert Uytterhoeven authored
      With some versions of gcc (e.g. 4.1.2):
      
      drivers/pwm/core.c: In function ‘pwm_get’:
      drivers/pwm/core.c:610: warning: ‘polarity’ may be used uninitialized in this function
      drivers/pwm/core.c:609: warning: ‘period’ may be used uninitialized in this function
      
      While these are false positives, we can get rid of them by refactoring
      the code to store a pointer to the best match, as suggested before by
      Thierry Reding. This does require moving the mutex_unlock() down.
      
      Fixes: d717ea73
      
       ("pwm: Fix period and polarity in pwm_get() for non-perfect matches")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      70145f87
  4. Aug 26, 2014
  5. Aug 25, 2014
  6. Aug 23, 2014
  7. Aug 22, 2014
  8. Aug 20, 2014
  9. 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
  10. Aug 17, 2014
  11. Aug 16, 2014