mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: rt9123: Fix sparse cast warning
@ 2025-05-08  3:01 cy_huang
  2025-05-09  1:36 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: cy_huang @ 2025-05-08  3:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, ChiYuan Huang,
	linux-sound, linux-kernel, kernel test robot

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-09  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-08  3:01 [PATCH] ASoC: codecs: rt9123: Fix sparse cast warning cy_huang
2025-05-09  1:36 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®