mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Peng Fan <peng.fan@nxp.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: sound/arm/pxa2xx-ac97-lib.c:334 pxa2xx_ac97_hw_probe() warn: passing zero to 'PTR_ERR'
Date: Tue, 7 Apr 2026 11:35:04 +0300	[thread overview]
Message-ID: <202604041426.i2C1xqHk-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7ca6d1cfec80ebe46cc063f3284c5896c344d9a1
commit: c76d50b71e898694c946993eb3c77f50efa97254 ASoC: ac97: Convert to GPIO descriptors
config: microblaze-randconfig-r072-20260404 (https://download.01.org/0day-ci/archive/20260404/202604041426.i2C1xqHk-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.5.0
smatch: v0.5.0-9004-gb810ac53

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
| Fixes: c76d50b71e89 ("ASoC: ac97: Convert to GPIO descriptors")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202604041426.i2C1xqHk-lkp@intel.com/

smatch warnings:
sound/arm/pxa2xx-ac97-lib.c:334 pxa2xx_ac97_hw_probe() warn: passing zero to 'PTR_ERR'

vim +/PTR_ERR +334 sound/arm/pxa2xx-ac97-lib.c

e21596bba143563 Bill Pemberton   2012-12-06  320  int pxa2xx_ac97_hw_probe(struct platform_device *dev)
9c63634221f6745 Dmitry Baryshkov 2008-09-10  321  {
9c63634221f6745 Dmitry Baryshkov 2008-09-10  322  	int ret;
2548e6c76ebfae0 Arnd Bergmann    2019-09-10  323  	int irq;
26ade896b6ba3fd Robert Jarzmik   2009-03-15  324  
8ff064521f97554 Arnd Bergmann    2019-09-18  325  	ac97_reg_base = devm_platform_ioremap_resource(dev, 0);
8ff064521f97554 Arnd Bergmann    2019-09-18  326  	if (IS_ERR(ac97_reg_base)) {
8ff064521f97554 Arnd Bergmann    2019-09-18  327  		dev_err(&dev->dev, "Missing MMIO resource\n");
8ff064521f97554 Arnd Bergmann    2019-09-18  328  		return PTR_ERR(ac97_reg_base);
8ff064521f97554 Arnd Bergmann    2019-09-18  329  	}
8ff064521f97554 Arnd Bergmann    2019-09-18  330  
be829277ef79aa6 Peng Fan         2026-01-22  331  	if (dev->dev.of_node) {
c76d50b71e89869 Peng Fan         2026-01-22  332  		/* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
c76d50b71e89869 Peng Fan         2026-01-22  333  		rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
c76d50b71e89869 Peng Fan         2026-01-22 @334  		ret = PTR_ERR(rst_gpio);

This was intended to be PTR_ERR_OR_ZERO(rst_gpio)

c76d50b71e89869 Peng Fan         2026-01-22  335  		if (ret == -ENOENT)
be829277ef79aa6 Peng Fan         2026-01-22  336  			reset_gpio = -1;
c76d50b71e89869 Peng Fan         2026-01-22  337  		else if (ret)
c76d50b71e89869 Peng Fan         2026-01-22  338  			return ret;

Otherwise we always return here.

c76d50b71e89869 Peng Fan         2026-01-22  339  		reset_gpio = desc_to_gpio(rst_gpio);
26ade896b6ba3fd Robert Jarzmik   2009-03-15  340  	} else {
26ade896b6ba3fd Robert Jarzmik   2009-03-15  341  		if (cpu_is_pxa27x())
26ade896b6ba3fd Robert Jarzmik   2009-03-15  342  			reset_gpio = 113;
26ade896b6ba3fd Robert Jarzmik   2009-03-15  343  	}
9c63634221f6745 Dmitry Baryshkov 2008-09-10  344  
9d1cf39be670976 Dmitry Baryshkov 2008-09-10  345  	if (cpu_is_pxa27x()) {
3b4bc7bccc78572 Mike Dunn        2013-01-07  346  		/*
3b4bc7bccc78572 Mike Dunn        2013-01-07  347  		 * This gpio is needed for a work-around to a bug in the ac97
3b4bc7bccc78572 Mike Dunn        2013-01-07  348  		 * controller during warm reset.  The direction and level is set
3b4bc7bccc78572 Mike Dunn        2013-01-07  349  		 * here so that it is an output driven high when switching from
3b4bc7bccc78572 Mike Dunn        2013-01-07  350  		 * AC97_nRESET alt function to generic gpio.
3b4bc7bccc78572 Mike Dunn        2013-01-07  351  		 */
c76d50b71e89869 Peng Fan         2026-01-22  352  		gpiod_set_consumer_name(rst_gpio, "pxa27x ac97 reset");
053fe0f166e540a Mike Dunn        2013-01-07  353  		pxa27x_configure_ac97reset(reset_gpio, false);
3b4bc7bccc78572 Mike Dunn        2013-01-07  354  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2026-04-07  8:35 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=202604041426.i2C1xqHk-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=peng.fan@nxp.com \
    /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 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®