Linux ACPI
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: linux-media@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-acpi@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	Hans de Goede <hansg@kernel.org>,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2 5/5] platform/x86: int3472: Clean up GPIO parsing
Date: Tue, 25 Aug 2026 13:54:42 +0300	[thread overview]
Message-ID: <ao10ctlOyvH5eMlf@kekkonen.localdomain> (raw)
In-Reply-To: <dbf333db-28ca-78ab-db76-f1773db844c7@linux.intel.com>

Moi,

On Tue, Aug 25, 2026 at 01:40:25PM +0300, Ilpo Järvinen wrote:
> On Tue, 25 Aug 2026, Sakari Ailus wrote:
> 
> > In skl_int3472_handle_gpio_resources(), return an error where it happens,
> > except when we're holding a reference to a GPIO. This involves
> > incrementing ngpios earlier on but that does not introduce a functional
> > change.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> >  drivers/platform/x86/intel/int3472/discrete.c | 42 +++++++++----------
> >  1 file changed, 21 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
> > index 2024eaa09033..400bee9e4cb8 100644
> > --- a/drivers/platform/x86/intel/int3472/discrete.c
> > +++ b/drivers/platform/x86/intel/int3472/discrete.c
> > @@ -369,15 +369,23 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
> >  		agpio->resource_source.string_ptr, agpio->pin_table[0],
> >  		str_high_low(gpio_flags == GPIO_ACTIVE_HIGH));
> >  
> > +	/*
> > +	 * int3472->ngpios can be incremented here as it is an argument to the
> > +	 * _DSM, not e.g. an index to an array in C. Additionally, in case of an
> > +	 * error the value won't be used.
> > +	 */
> 
> I wasn't expecting comment for this. You might have added it because of 
> my questions but IMO it's not needed.
> 
> I think just the old way/place was confusing, especially given how 
> some/part of the error cases did increment it. But after moving it here, 
> it makes much more sense even without that comment.
> 
> And one can determine it's not being used for C arrays by using grep so 
> that too seems just unnecessary detail.

Ok, I'll drop it.

> 
> > +	int3472->ngpios++;
> > +
> >  	switch (type) {
> >  	case INT3472_GPIO_TYPE_RESET:
> >  	case INT3472_GPIO_TYPE_POWERDOWN:
> >  	case INT3472_GPIO_TYPE_HOTPLUG_DETECT:
> >  		ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, con_id, gpio_flags);
> >  		if (ret)
> > -			dev_err_probe(int3472->dev, ret, "Failed to map GPIO pin to sensor\n");
> > +			return dev_err_probe(int3472->dev, ret,
> > +					     "Failed to map GPIO pin to sensor\n");
> >  
> > -		break;
> > +		return 0;
> >  	case INT3472_GPIO_TYPE_CLK_ENABLE:
> >  	case INT3472_GPIO_TYPE_PRIVACY_LED:
> >  	case INT3472_GPIO_TYPE_STROBE:
> > @@ -385,24 +393,24 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
> >  	case INT3472_GPIO_TYPE_DOVDD:
> >  	case INT3472_GPIO_TYPE_HANDSHAKE:
> >  		gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, con_id, gpio_flags);
> > -		if (IS_ERR(gpio)) {
> > -			ret = PTR_ERR(gpio);
> > -			dev_err_probe(int3472->dev, ret, "Failed to get GPIO\n");
> > -			break;
> > -		}
> > +		if (IS_ERR(gpio))
> > +			return dev_err_probe(int3472->dev, PTR_ERR(gpio),
> > +					     "Failed to get GPIO\n");
> >  
> >  		switch (type) {
> >  		case INT3472_GPIO_TYPE_CLK_ENABLE:
> >  			ret = skl_int3472_register_gpio_clock(int3472, gpio);
> >  			if (ret)
> > -				dev_err_probe(int3472->dev, ret, "Failed to register clock\n");
> > +				dev_err_probe(int3472->dev, ret,
> > +					      "Failed to register clock\n");
> 
> Don't know why changed linesplits in this instead doing them directly in 
> the 2nd patch.

Oops, that's where I intended to make them. I'll fix that for v3.

-- 
Sakari Ailus

      reply	other threads:[~2026-08-25 10:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 21:13 [PATCH v2 0/5] Fix static analyser and compiler warnings in int3472 Sakari Ailus
2026-08-24 21:13 ` [PATCH v2 1/5] platform/x86: int3472: Address Coccinelle warning on an error print Sakari Ailus
2026-08-24 21:13 ` [PATCH v2 2/5] platform/x86: int3472: Fix uninitialised variable warning Sakari Ailus
2026-08-24 21:13 ` [PATCH v2 3/5] ACPI: Support __free() from cleanup.h for ACPI objects Sakari Ailus
2026-08-25 11:51   ` Rafael J. Wysocki (Intel)
2026-08-25 12:07     ` Sakari Ailus
2026-08-25 12:18       ` Rafael J. Wysocki (Intel)
2026-08-25 12:32         ` Ilpo Järvinen
2026-08-25 13:02           ` Rafael J. Wysocki (Intel)
2026-08-25 13:08             ` Rafael J. Wysocki (Intel)
2026-08-25 13:51               ` Ilpo Järvinen
2026-08-25 14:42                 ` Rafael J. Wysocki (Intel)
2026-08-25 19:35               ` Sakari Ailus
2026-08-26  9:04                 ` Ilpo Järvinen
2026-08-26 10:17                   ` Rafael J. Wysocki (Intel)
2026-08-25 13:37             ` Ilpo Järvinen
2026-08-25 13:49               ` Rafael J. Wysocki (Intel)
2026-08-24 21:13 ` [PATCH v2 4/5] platform/x86: int3472: Release ACPI objects using __free() Sakari Ailus
2026-08-25 11:54   ` Rafael J. Wysocki (Intel)
2026-08-25 12:04     ` Sakari Ailus
2026-08-25 12:32       ` Rafael J. Wysocki (Intel)
2026-08-24 21:13 ` [PATCH v2 5/5] platform/x86: int3472: Clean up GPIO parsing Sakari Ailus
2026-08-25 10:40   ` Ilpo Järvinen
2026-08-25 10:54     ` Sakari Ailus [this message]

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=ao10ctlOyvH5eMlf@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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