From: kernel test robot <lkp@intel.com>
To: ChiYuan Huang <cy_huang@richtek.com>
Cc: oe-kbuild-all@lists.linux.dev, Mark Brown <broonie@kernel.org>
Subject: [linux-next:master 2804/9308] sound/soc/codecs/rt9123.c:406:17: sparse: sparse: cast to restricted __be16
Date: Wed, 7 May 2025 21:34:49 +0800 [thread overview]
Message-ID: <202505072140.iHyLlDN6-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 08710e696081d58163c8078e0e096be6d35c5fad
commit: 8bffd24e45618b6c3d6ce11947193c6d8ba846a7 [2804/9308] ASoC: codecs: Add support for Richtek rt9123
config: csky-randconfig-r133-20250417 (https://download.01.org/0day-ci/archive/20250507/202505072140.iHyLlDN6-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250507/202505072140.iHyLlDN6-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505072140.iHyLlDN6-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> sound/soc/codecs/rt9123.c:406:17: sparse: sparse: cast to restricted __be16
>> sound/soc/codecs/rt9123.c:412:66: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __be16 [assigned] [usertype] value @@
sound/soc/codecs/rt9123.c:412:66: sparse: expected unsigned short [usertype] value
sound/soc/codecs/rt9123.c:412:66: sparse: got restricted __be16 [assigned] [usertype] value
vim +406 sound/soc/codecs/rt9123.c
379
380 static int rt9123_i2c_probe(struct i2c_client *i2c)
381 {
382 struct device *dev = &i2c->dev;
383 struct rt9123_priv *rt9123;
384 struct regmap *regmap;
385 __be16 value;
386 u16 venid;
387 int ret;
388
389 rt9123 = devm_kzalloc(dev, sizeof(*rt9123), GFP_KERNEL);
390 if (!rt9123)
391 return -ENOMEM;
392
393 rt9123->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
394 if (IS_ERR(rt9123->enable))
395 return PTR_ERR(rt9123->enable);
396 else if (rt9123->enable)
397 usleep_range(250, 350);
398 else
399 dev_dbg(dev, "No 'enable' GPIO specified, treat it as default on\n");
400
401 /* Check vendor id information */
402 ret = i2c_smbus_read_word_data(i2c, RT9123_REG_COMBOID);
403 if (ret < 0)
404 return dev_err_probe(dev, ret, "Failed to read vendor-id\n");
405
> 406 venid = be16_to_cpu(ret);
407 if ((venid & RT9123_MASK_VENID) != RT9123_FIXED_VENID)
408 return dev_err_probe(dev, -ENODEV, "Incorrect vendor-id 0x%04x\n", venid);
409
410 /* Trigger RG reset before regmap init cache */
411 value = cpu_to_be16(RT9123_MASK_SWRST);
> 412 ret = i2c_smbus_write_word_data(i2c, RT9123_REG_AMPCTRL, value);
413 if (ret)
414 return dev_err_probe(dev, ret, "Failed to trigger RG reset\n");
415
416 /* Need to wait 10ms for the reset to complete */
417 usleep_range(10000, 11000);
418
419 regmap = devm_regmap_init_i2c(i2c, &rt9123_regmap_config);
420 if (IS_ERR(regmap))
421 return dev_err_probe(dev, PTR_ERR(regmap), "Failed to init regmap\n");
422
423 i2c_set_clientdata(i2c, rt9123);
424
425 pm_runtime_set_autosuspend_delay(dev, 500);
426 pm_runtime_use_autosuspend(dev);
427 pm_runtime_set_active(dev);
428 ret = devm_pm_runtime_enable(dev);
429 if (ret)
430 return dev_err_probe(dev, ret, "Failed to enable pm runtime\n");
431
432 return devm_snd_soc_register_component(dev, &rt9123_comp_driver, &rt9123_dai_driver, 1);
433 }
434
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-05-07 13:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202505072140.iHyLlDN6-lkp@intel.com \
--to=lkp@intel.com \
--cc=broonie@kernel.org \
--cc=cy_huang@richtek.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.