Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] gpiolib: fix hogs with multiple lines
Date: Wed, 25 Mar 2026 14:26:10 +0200	[thread overview]
Message-ID: <acPUYlO4VUDNctBX@ashevche-desk.local> (raw)
In-Reply-To: <20260325-gpio-hogs-multiple-v1-1-7e3a7347f0d6@oss.qualcomm.com>

On Wed, Mar 25, 2026 at 11:18:32AM +0100, Bartosz Golaszewski wrote:
> After moving GPIO hog handling into GPIOLIB core, we accidentally stopped
> supporting devicetree hog definitions with multiple lines like so:
> 
> 	hog {
> 		gpio-hog;
> 		gpios = <3 0>, <4 GPIO_ACTIVE_LOW>;
> 		output-high;
> 		line-name = "foo";
> 	};
> 
> Restore this functionality to fix reported regressions.

...

> +	ret = fwnode_property_read_u32(gc_node, "#gpio-cells", &cells);
> +	if ((ret && is_of_node(fwnode)) || (!ret && (argc % cells)))
>  		return -EINVAL;

Hmm... Shouldn't we return the proper error code in the first case?

	if (ret && is_of_node(fwnode))
		return ret;
	if (!ret && (argc % cells))
		return -EINVAL;

...

> +	u32 *gpios __free(kfree) = kcalloc(argc, sizeof(u32), GFP_KERNEL);

sizeof(*gpios)

> +	if (!gpios)
> +		return -ENOMEM;

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-25 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 10:18 [PATCH] gpiolib: fix hogs with multiple lines Bartosz Golaszewski
2026-03-25 12:26 ` Andy Shevchenko [this message]
2026-03-25 18:41 ` Geert Uytterhoeven
2026-03-26 13:54   ` Bartosz Golaszewski

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=acPUYlO4VUDNctBX@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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