mirror of
https://github.com/torvalds/linux.git
synced 2026-12-04 12:24:18 +00:00
platform/x86/amd/pmc: Use managed APIs for mutex
Adopt managed devm_* APIs for handling mutex creation and deletion, facilitating automatic resource cleanup. Co-developed-by: Sanket Goswami <[email protected]> Signed-off-by: Sanket Goswami <[email protected]> Signed-off-by: Shyam Sundar S K <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
This commit is contained in:
@@ -783,7 +783,9 @@ static int amd_pmc_probe(struct platform_device *pdev)
|
||||
goto err_pci_dev_put;
|
||||
}
|
||||
|
||||
mutex_init(&dev->lock);
|
||||
err = devm_mutex_init(dev->dev, &dev->lock);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* Get num of IP blocks within the SoC */
|
||||
amd_pmc_get_ip_info(dev);
|
||||
@@ -822,7 +824,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[] = {
|
||||
|
||||
Reference in New Issue
Block a user