]> git.baikalelectronics.ru Git - kernel.git/commit
spi: core: Fix spi_register_master error handling
authorAxel Lin <axel.lin@ingics.com>
Sat, 31 Aug 2013 12:25:52 +0000 (20:25 +0800)
committerMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 16:51:06 +0000 (17:51 +0100)
commit6aeb4c8a3be8373c478abafac57361687311d5f0
tree505925425d5e1df0e15e5cba534141a6b6d034b3
parent1e81a337277f431b0bdf288193fcb4660b1fa197
spi: core: Fix spi_register_master error handling

In the case spi_master_initialize_queue() fails, current code calls
device_unregister() before return error from spi_register_master().
However, all the drivers call spi_master_put() in the error path if
spi_register_master() fails. Thus we should call device_del() rather than
device_unregister() before return error from spi_register_master().

This also makes all the spi_register_master() error handling consistent,
because all other error paths of spi_register_master() expect drivers to
call spi_master_put() if spi_register_master() fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi.c