All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: phucduc.bui@gmail.com, Linus Walleij <linusw@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Darian Biastoch <d.biastoch@gmail.com>,
	Andreas Kaessens <akaessens@gmail.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: Re: [PATCH] pinctrl: mcp23s08: Propagate reset GPIO errors
Date: Sat, 10 Oct 2026 09:25:59 +0800	[thread overview]
Message-ID: <202610100943.RQhhOoh8-lkp@intel.com> (raw)
In-Reply-To: <20261009112634.33436-1-phucduc.bui@gmail.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linusw-pinctrl/for-next]
[also build test WARNING on linus/master v7.3-rc6 next-20261008]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/phucduc-bui-gmail-com/pinctrl-mcp23s08-Propagate-reset-GPIO-errors/20261009-182634
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
patch link:    https://lore.kernel.org/r/20261009112634.33436-1-phucduc.bui%40gmail.com
patch subject: [PATCH] pinctrl: mcp23s08: Propagate reset GPIO errors
config: powerpc64-randconfig-1000-20261010 (https://download.01.org/0day-ci/archive/20261010/202610100943.RQhhOoh8-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 242243a5814307de825db3428662d67b064e2cbc)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261010/202610100943.RQhhOoh8-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/202610100943.RQhhOoh8-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/pinctrl/pinctrl-mcp23s08.c:617:29: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     617 |                 return dev_err_probe(dev, ret, "failed to get reset GPIO\n");
         |                                           ^~~
   drivers/pinctrl/pinctrl-mcp23s08.c:592:17: note: initialize the variable 'ret' to silence this warning
     592 |         int status, ret;
         |                        ^
         |                         = 0
   1 warning generated.


vim +/ret +617 drivers/pinctrl/pinctrl-mcp23s08.c

   588	
   589	int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
   590			       unsigned int addr, unsigned int type, unsigned int base)
   591	{
   592		int status, ret;
   593		bool mirror = false;
   594		bool open_drain = false;
   595	
   596		mutex_init(&mcp->lock);
   597	
   598		mcp->dev = dev;
   599		mcp->addr = addr;
   600	
   601		mcp->irq_active_high = false;
   602	
   603		mcp->chip.direction_input = mcp23s08_direction_input;
   604		mcp->chip.get = mcp23s08_get;
   605		mcp->chip.get_multiple = mcp23s08_get_multiple;
   606		mcp->chip.direction_output = mcp23s08_direction_output;
   607		mcp->chip.set = mcp23s08_set;
   608		mcp->chip.set_multiple = mcp23s08_set_multiple;
   609	
   610		mcp->chip.base = base;
   611		mcp->chip.can_sleep = true;
   612		mcp->chip.parent = dev;
   613		mcp->chip.owner = THIS_MODULE;
   614	
   615		mcp->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
   616		if (IS_ERR(mcp->reset_gpio))
 > 617			return dev_err_probe(dev, ret, "failed to get reset GPIO\n");
   618	
   619		/* verify MCP_IOCON.SEQOP = 0, so sequential reads work,
   620		 * and MCP_IOCON.HAEN = 1, so we work with all chips.
   621		 */
   622	
   623		ret = mcp_read(mcp, MCP_IOCON, &status);
   624		if (ret < 0)
   625			return dev_err_probe(dev, ret, "can't identify chip %d\n", addr);
   626	
   627		mcp->irq_controller =
   628			device_property_read_bool(dev, "interrupt-controller");
   629		if (mcp->irq && mcp->irq_controller) {
   630			mcp->irq_active_high =
   631				device_property_read_bool(dev,
   632						      "microchip,irq-active-high");
   633	
   634			mirror = device_property_read_bool(dev, "microchip,irq-mirror");
   635			open_drain = device_property_read_bool(dev, "drive-open-drain");
   636		}
   637	
   638		if ((status & IOCON_SEQOP) || !(status & IOCON_HAEN) || mirror ||
   639		     mcp->irq_active_high || open_drain) {
   640			/* mcp23s17 has IOCON twice, make sure they are in sync */
   641			status &= ~(IOCON_SEQOP | (IOCON_SEQOP << 8));
   642			status |= IOCON_HAEN | (IOCON_HAEN << 8);
   643			if (mcp->irq_active_high)
   644				status |= IOCON_INTPOL | (IOCON_INTPOL << 8);
   645			else
   646				status &= ~(IOCON_INTPOL | (IOCON_INTPOL << 8));
   647	
   648			if (mirror)
   649				status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
   650	
   651			if (open_drain)
   652				status |= IOCON_ODR | (IOCON_ODR << 8);
   653	
   654			if (type == MCP_TYPE_S18 || type == MCP_TYPE_018)
   655				status |= IOCON_INTCC | (IOCON_INTCC << 8);
   656	
   657			ret = mcp_write(mcp, MCP_IOCON, status);
   658			if (ret < 0)
   659				return dev_err_probe(dev, ret, "can't write IOCON %d\n", addr);
   660		}
   661	
   662		if (mcp->irq && mcp->irq_controller) {
   663			struct gpio_irq_chip *girq = &mcp->chip.irq;
   664	
   665			/*
   666			 * Disable all pin interrupts, to prevent the interrupt handler from
   667			 * calling nested handlers for any currently-enabled interrupts that
   668			 * do not (yet) have an actual handler.
   669			 */
   670			ret = mcp_write(mcp, MCP_GPINTEN, 0);
   671			if (ret < 0)
   672				return dev_err_probe(dev, ret, "can't disable interrupts\n");
   673	
   674			gpio_irq_chip_set_chip(girq, &mcp23s08_irq_chip);
   675			/* This will let us handle the parent IRQ in the driver */
   676			girq->parent_handler = NULL;
   677			girq->num_parents = 0;
   678			girq->parents = NULL;
   679			girq->default_type = IRQ_TYPE_NONE;
   680			girq->handler = handle_simple_irq;
   681			girq->threaded = true;
   682		}
   683	
   684		ret = devm_gpiochip_add_data(dev, &mcp->chip, mcp);
   685		if (ret < 0)
   686			return dev_err_probe(dev, ret, "can't add GPIO chip\n");
   687	
   688		mcp->pinctrl_desc.pctlops = &mcp_pinctrl_ops;
   689		mcp->pinctrl_desc.confops = &mcp_pinconf_ops;
   690		mcp->pinctrl_desc.npins = mcp->chip.ngpio;
   691		if (mcp->pinctrl_desc.npins == 8)
   692			mcp->pinctrl_desc.pins = mcp23x08_pins;
   693		else if (mcp->pinctrl_desc.npins == 16)
   694			mcp->pinctrl_desc.pins = mcp23x17_pins;
   695		mcp->pinctrl_desc.owner = THIS_MODULE;
   696	
   697		mcp->pctldev = devm_pinctrl_register(dev, &mcp->pinctrl_desc, mcp);
   698		if (IS_ERR(mcp->pctldev))
   699			return dev_err_probe(dev, PTR_ERR(mcp->pctldev), "can't register controller\n");
   700	
   701		if (mcp->irq) {
   702			ret = mcp23s08_irq_setup(mcp);
   703			if (ret)
   704				return dev_err_probe(dev, ret, "can't setup IRQ\n");
   705		}
   706	
   707		return 0;
   708	}
   709	EXPORT_SYMBOL_GPL(mcp23s08_probe_one);
   710	

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

  parent reply	other threads:[~2026-10-10  1:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 11:26 [PATCH] pinctrl: mcp23s08: Propagate reset GPIO errors phucduc.bui
2026-10-09 11:34 ` sashiko-bot
2026-10-10  3:23   ` Bui Duc Phuc
2026-10-10  1:25 ` kernel test robot [this message]
2026-10-10  3:26   ` Bui Duc Phuc

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=202610100943.RQhhOoh8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akaessens@gmail.com \
    --cc=d.biastoch@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=phucduc.bui@gmail.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 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.