[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5bbf80a-36b1-fd29-dbdb-ae47e06b0c7b@gmail.com>
Date: Mon, 21 Jun 2021 23:32:13 +0100
From: Daniel Scally <djrscally@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Hans de Goede <hdegoede@...hat.com>,
Mario Limonciello <mario.limonciello@....com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Cc: Mark Gross <mgross@...ux.intel.com>
Subject: Re: [PATCH v2 2/8] platform/x86: intel_skl_int3472: Free ACPI device
resources after use
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@...ux.intel.com>
Sorry, only just got round to these:
Reviewed-by: Daniel Scally <djrscally@...il.com>
Tested-by: Daniel Scally <djrscally@...il.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)
Powered by blists - more mailing lists