Unverified Commit 9b3bb37b authored by Mario Limonciello's avatar Mario Limonciello Committed by Ilpo Järvinen
Browse files

ACPI: platform_profile: Add platform handler argument to platform_profile_remove()



To allow registering and unregistering multiple platform handlers calls
to platform_profile_remove() will need to know which handler is to be
removed.  Add an argument for this.

Tested-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: default avatarMatthew Schwartz <matthew.schwartz@linux.dev>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: default avatarArmin Wolf <W_Armin@gmx.de>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20241206031918.1537-5-mario.limonciello@amd.com


Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 6f5e63dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ int platform_profile_register(struct platform_profile_handler *pprof)
}
EXPORT_SYMBOL_GPL(platform_profile_register);

int platform_profile_remove(void)
int platform_profile_remove(struct platform_profile_handler *pprof)
{
	sysfs_remove_group(acpi_kobj, &platform_profile_group);

+5 −1
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
		return -ENOMEM;

	tpd->sdev = sdev;
	ssam_device_set_drvdata(sdev, tpd);

	tpd->handler.name = "Surface Platform Profile";
	tpd->handler.dev = &sdev->dev;
@@ -228,7 +229,10 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)

static void surface_platform_profile_remove(struct ssam_device *sdev)
{
	platform_profile_remove();
	struct ssam_platform_profile_device *tpd;

	tpd = ssam_device_get_drvdata(sdev);
	platform_profile_remove(&tpd->handler);
}

static const struct ssam_device_id ssam_platform_profile_match[] = {
+2 −2
Original line number Diff line number Diff line
@@ -2547,7 +2547,7 @@ static int acer_platform_probe(struct platform_device *device)

error_hwmon:
	if (platform_profile_support)
		platform_profile_remove();
		platform_profile_remove(&platform_profile_handler);
error_platform_profile:
	acer_rfkill_exit();
error_rfkill:
@@ -2570,7 +2570,7 @@ static void acer_platform_remove(struct platform_device *device)
	acer_rfkill_exit();

	if (platform_profile_support)
		platform_profile_remove();
		platform_profile_remove(&platform_profile_handler);
}

#ifdef CONFIG_PM_SLEEP
+1 −1
Original line number Diff line number Diff line
@@ -426,5 +426,5 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev)

void amd_pmf_deinit_sps(struct amd_pmf_dev *dev)
{
	platform_profile_remove();
	platform_profile_remove(&dev->pprof);
}
+2 −2
Original line number Diff line number Diff line
@@ -4852,7 +4852,7 @@ static int asus_wmi_add(struct platform_device *pdev)
fail_custom_fan_curve:
fail_platform_profile_setup:
	if (asus->platform_profile_support)
		platform_profile_remove();
		platform_profile_remove(&asus->platform_profile_handler);
fail_fan_boost_mode:
fail_platform:
	kfree(asus);
@@ -4879,7 +4879,7 @@ static void asus_wmi_remove(struct platform_device *device)
	asus_wmi_battery_exit(asus);

	if (asus->platform_profile_support)
		platform_profile_remove();
		platform_profile_remove(&asus->platform_profile_handler);

	kfree(asus);
}
Loading