X86 platform drivers
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Sanket.Goswami@amd.com,  platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 4/4] platform/x86/amd/pmc: Use managed APIs for mutex
Date: Wed, 5 Mar 2025 14:16:03 +0200 (EET)	[thread overview]
Message-ID: <b762fb76-970c-1106-d990-1160372688bb@linux.intel.com> (raw)
In-Reply-To: <20250217081720.107719-4-Shyam-sundar.S-k@amd.com>

On Mon, 17 Feb 2025, Shyam Sundar S K wrote:

> Adopt managed devm_* APIs for handling mutex creation and deletion,
> facilitating automatic resource cleanup.
> 
> Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
>  drivers/platform/x86/amd/pmc/pmc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
> index d80a5b899a1d..f4768bd6b424 100644
> --- a/drivers/platform/x86/amd/pmc/pmc.c
> +++ b/drivers/platform/x86/amd/pmc/pmc.c
> @@ -778,7 +778,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
>  		goto err_pci_dev_put;
>  	}
>  
> -	mutex_init(&dev->lock);
> +	devm_mutex_init(dev->dev, &dev->lock);

Please add error handling.

>  
>  	/* Get num of IP blocks within the SoC */
>  	amd_pmc_get_ip_info(dev);
> @@ -817,7 +817,6 @@ static void amd_pmc_remove(struct platform_device *pdev)
>  	pci_dev_put(dev->rdev);
>  	if (IS_ENABLED(CONFIG_AMD_MP2_STB))
>  		amd_mp2_stb_deinit(dev);
> -	mutex_destroy(&dev->lock);
>  }
>  
>  static const struct acpi_device_id amd_pmc_acpi_ids[] = {
> 

-- 
 i.


  reply	other threads:[~2025-03-05 12:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17  8:17 [PATCH 1/4] platform/x86/amd/pmc: Notify user when platform does not support s0ix transition Shyam Sundar S K
2025-02-17  8:17 ` [PATCH 2/4] platform/x86/amd/pmc: Move macros and structures to the PMC header file Shyam Sundar S K
2025-02-17  8:17 ` [PATCH 3/4] platform/x86/amd/pmc: Remove unnecessary line breaks Shyam Sundar S K
2025-02-17 15:38   ` Mario Limonciello
2025-02-18  7:08     ` Shyam Sundar S K
2025-02-18 14:52       ` Mario Limonciello
2025-03-05 12:21   ` Ilpo Järvinen
2025-02-17  8:17 ` [PATCH 4/4] platform/x86/amd/pmc: Use managed APIs for mutex Shyam Sundar S K
2025-03-05 12:16   ` Ilpo Järvinen [this message]
2025-02-17 15:40 ` [PATCH 1/4] platform/x86/amd/pmc: Notify user when platform does not support s0ix transition Mario Limonciello

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=b762fb76-970c-1106-d990-1160372688bb@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Sanket.Goswami@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hdegoede@redhat.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