[PATCH] ASoC: codecs: rt9123: Fix sparse cast warning

cy_huang@richtek.com posted 1 patch 7 months, 1 week ago
sound/soc/codecs/rt9123.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] ASoC: codecs: rt9123: Fix sparse cast warning
Posted by cy_huang@richtek.com 7 months, 1 week ago
From: ChiYuan Huang <cy_huang@richtek.com>

Use i2c block read/write API to fix casting warning.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505072140.iHyLlDN6-lkp@intel.com/
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
 sound/soc/codecs/rt9123.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/rt9123.c b/sound/soc/codecs/rt9123.c
index d9a22fda3d26..242e8c975a62 100644
--- a/sound/soc/codecs/rt9123.c
+++ b/sound/soc/codecs/rt9123.c
@@ -399,17 +399,17 @@ static int rt9123_i2c_probe(struct i2c_client *i2c)
 		dev_dbg(dev, "No 'enable' GPIO specified, treat it as default on\n");
 
 	/* Check vendor id information */
-	ret = i2c_smbus_read_word_data(i2c, RT9123_REG_COMBOID);
+	ret = i2c_smbus_read_i2c_block_data(i2c, RT9123_REG_COMBOID, sizeof(value), (u8 *)&value);
 	if (ret < 0)
 		return dev_err_probe(dev, ret, "Failed to read vendor-id\n");
 
-	venid = be16_to_cpu(ret);
+	venid = be16_to_cpu(value);
 	if ((venid & RT9123_MASK_VENID) != RT9123_FIXED_VENID)
 		return dev_err_probe(dev, -ENODEV, "Incorrect vendor-id 0x%04x\n", venid);
 
 	/* Trigger RG reset before regmap init cache */
 	value = cpu_to_be16(RT9123_MASK_SWRST);
-	ret = i2c_smbus_write_word_data(i2c, RT9123_REG_AMPCTRL, value);
+	ret = i2c_smbus_write_i2c_block_data(i2c, RT9123_REG_AMPCTRL, sizeof(value), (u8 *)&value);
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to trigger RG reset\n");
 
-- 
2.34.1
Re: [PATCH] ASoC: codecs: rt9123: Fix sparse cast warning
Posted by Mark Brown 7 months, 1 week ago
On Thu, 08 May 2025 11:01:23 +0800, cy_huang@richtek.com wrote:
> Use i2c block read/write API to fix casting warning.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: codecs: rt9123: Fix sparse cast warning
      commit: 07cb9b51076f452c286fb69f3af4c65e54affaa3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark