platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Scally <djrscally@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Cc: Mark Gross <mgross@linux.intel.com>
Subject: Re: [PATCH v2 2/8] platform/x86: intel_skl_int3472: Free ACPI device resources after use
Date: Mon, 21 Jun 2021 23:32:13 +0100	[thread overview]
Message-ID: <d5bbf80a-36b1-fd29-dbdb-ae47e06b0c7b@gmail.com> (raw)
In-Reply-To: <20210618125516.53510-2-andriy.shevchenko@linux.intel.com>

Hi Andy

On 18/06/2021 13:55, Andy Shevchenko wrote:
> We may free ACPI device resources immediately after use.
> Refactor skl_int3472_parse_crs() accordingly.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Sorry, only just got round to these:


Reviewed-by: Daniel Scally <djrscally@gmail.com>

Tested-by: Daniel Scally <djrscally@gmail.com>

> ---
> v2: new patch
>  .../x86/intel-int3472/intel_skl_int3472_discrete.c  | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c b/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c
> index 8c18dbff1c43..48a00a1f4fb6 100644
> --- a/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c
> +++ b/drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c
> @@ -308,8 +308,10 @@ static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
>  	ret = acpi_dev_get_resources(int3472->adev, &resource_list,
>  				     skl_int3472_handle_gpio_resources,
>  				     int3472);
> -	if (ret)
> -		goto out_free_res_list;
> +	if (ret < 0)
> +		return ret;
> +
> +	acpi_dev_free_resource_list(&resource_list);
>  
>  	/*
>  	 * If we find no clock enable GPIO pin then the privacy LED won't work.
> @@ -319,7 +321,7 @@ static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
>  	if (int3472->clock.ena_gpio) {
>  		ret = skl_int3472_register_clock(int3472);
>  		if (ret)
> -			goto out_free_res_list;
> +			return ret;
>  	} else {
>  		if (int3472->clock.led_gpio)
>  			dev_warn(int3472->dev,
> @@ -329,10 +331,7 @@ static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
>  	int3472->gpios.dev_id = int3472->sensor_name;
>  	gpiod_add_lookup_table(&int3472->gpios);
>  
> -out_free_res_list:
> -	acpi_dev_free_resource_list(&resource_list);
> -
> -	return ret;
> +	return 0;
>  }
>  
>  int skl_int3472_discrete_probe(struct platform_device *pdev)

  reply	other threads:[~2021-06-21 22:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 12:55 [PATCH v2 1/8] platform/x86: Remove "default n" entries Andy Shevchenko
2021-06-18 12:55 ` [PATCH v2 2/8] platform/x86: intel_skl_int3472: Free ACPI device resources after use Andy Shevchenko
2021-06-21 22:32   ` Daniel Scally [this message]
2021-06-18 12:55 ` [PATCH v2 3/8] platform/x86: intel_skl_int3472: Fix dependencies (drop CLKDEV_LOOKUP) Andy Shevchenko
2021-06-18 12:55 ` [PATCH v2 4/8] platform/x86: intel_skl_int3472: Use ACPI GPIO resource directly Andy Shevchenko
2021-06-21 22:37   ` Daniel Scally
2021-06-18 12:55 ` [PATCH v2 5/8] platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_regulator() Andy Shevchenko
2021-06-21 22:40   ` Daniel Scally
2021-06-18 12:55 ` [PATCH v2 6/8] platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_clock() Andy Shevchenko
2021-06-18 12:55 ` [PATCH v2 7/8] platform/x86: intel_skl_int3472: Move to intel/ subfolder Andy Shevchenko
2021-06-18 12:55 ` [PATCH v2 8/8] platform/x86: intel_cht_int33fe: Move to its own subfolder Andy Shevchenko
2021-06-22  9:02 ` [PATCH v2 1/8] platform/x86: Remove "default n" entries Andy Shevchenko
2021-06-22  9:03   ` Hans de Goede
2021-06-22  9:42 ` Hans de Goede
2021-06-22  9:46   ` Andy Shevchenko

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=d5bbf80a-36b1-fd29-dbdb-ae47e06b0c7b@gmail.com \
    --to=djrscally@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.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;
as well as URLs for NNTP newsgroup(s).