1. 17 9月, 2013 1 次提交
    • A
      spi: bitbang: Let spi_bitbang_start() take a reference to master · 94c69f76
      Axel Lin 提交于
      Many drivers that use bitbang library have a leak on probe error paths.
      This is because once a spi_master_get() call succeeds, we need an additional
      spi_master_put() call to free the memory.
      
      Fix this issue by moving the code taking a reference to master to
      spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
      success. With this change, the caller is responsible for calling
      spi_bitbang_stop() to decrement the reference and spi_master_put() as
      counterpart of spi_alloc_master() to prevent a memory leak.
      
      So now we have below patten for drivers using bitbang library:
      
      probe:
      spi_alloc_master        -> Init reference count to 1
      spi_bitbang_start       -> Increment reference count
      remove:
      spi_bitbang_stop        -> Decrement reference count
      spi_master_put          -> Decrement reference count (reference count reaches 0)
      
      Fixup all users accordingly.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Suggested-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Acked-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      94c69f76
  2. 29 8月, 2013 1 次提交
  3. 01 11月, 2011 1 次提交
  4. 25 10月, 2011 1 次提交
  5. 06 6月, 2011 1 次提交
  6. 04 7月, 2010 1 次提交
  7. 25 5月, 2010 1 次提交
    • H
      spi: move bitbang txrx utility functions to private header · 41c4221c
      hartleys 提交于
      A number of files in drivers/spi fail checkincludes.pl due to the double
      include of <linux/spi/spi_bitbang.h>.
      
      The first include is needed to get the struct spi_bitbang definition and
      the spi_bitbang_* function prototypes.
      
      The second include happens after defining EXPAND_BITBANG_TXRX to get the
      inlined bitbang_txrx_* utility functions.
      
      The <linux/spi/spi_bitbang.h> header is also included by a number of other
      spi drivers, as well as some arch/ code, in order to use struct spi_bitbang
      and the associated functions.
      
      To fix the double include, and remove any potential confusion about it, move
      the inlined bitbang_txrx_* functions to a new private header in drivers/spi
      and also remove the need to define EXPAND_BITBANG_TXRX.
      Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      41c4221c
  8. 18 12月, 2009 1 次提交
  9. 11 4月, 2008 1 次提交
  10. 07 2月, 2008 1 次提交