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

* Re: [PATCH] ASoC: codecs: rt9123: Fix sparse cast warning
  2025-05-08  3:01 [PATCH] ASoC: codecs: rt9123: Fix sparse cast warning cy_huang
@ 2025-05-09  1:36 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-05-09  1:36 UTC (permalink / raw)
  To: cy_huang
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
	linux-kernel, kernel test robot

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


^ 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®