]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: codecs: da7210: add check for i2c_add_driver
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 31 May 2022 09:47:12 +0000 (17:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:02 +0000 (14:24 +0200)
commitf38d44dddb1ddfb32bb0cda1cec36774a029996f
tree6eab37aafd0667892c9368313f0698115ebdb773
parenta0246a6a9e838fa88af5bc5e6c751577c90cebd1
ASoC: codecs: da7210: add check for i2c_add_driver

[ Upstream commit 1afbbb20f09d1db5bed5ced7565f71798fa394db ]

As i2c_add_driver could return error if fails, it should be
better to check the return value.
However, if the CONFIG_I2C and CONFIG_SPI_MASTER are both true,
the return value of i2c_add_driver will be covered by
spi_register_driver.
Therefore, it is necessary to add check and return error if fails.

Fixes: 9e6179430bfd ("ASoC: da7210: Add support for spi regmap")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220531094712.2376759-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/da7210.c