@@ -461,7 +461,7 @@ int platform_profile_cycle(void)
}
EXPORT_SYMBOL_GPL(platform_profile_cycle);
-int platform_profile_register(struct platform_profile_handler *pprof)
+int platform_profile_register(struct platform_profile_handler *pprof, void *drvdata)
{
int err;
@@ -490,6 +490,7 @@ int platform_profile_register(struct platform_profile_handler *pprof)
pprof->class_dev.class = &platform_profile_class;
pprof->class_dev.parent = pprof->dev;
+ dev_set_drvdata(&pprof->class_dev, drvdata);
dev_set_name(&pprof->class_dev, "platform-profile-%d", pprof->minor);
err = device_register(&pprof->class_dev);
if (err)
@@ -537,7 +538,7 @@ static void devm_platform_profile_release(struct device *dev, void *res)
platform_profile_remove(*pprof);
}
-int devm_platform_profile_register(struct platform_profile_handler *pprof)
+int devm_platform_profile_register(struct platform_profile_handler *pprof, void *drvdata)
{
struct platform_profile_handler **dr;
int ret;
@@ -546,7 +547,7 @@ int devm_platform_profile_register(struct platform_profile_handler *pprof)
if (!dr)
return -ENOMEM;
- ret = platform_profile_register(pprof);
+ ret = platform_profile_register(pprof, drvdata);
if (ret) {
devres_free(dr);
return ret;
@@ -234,7 +234,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
tpd->has_fan = device_property_read_bool(&sdev->dev, "has_fan");
- return platform_profile_register(&tpd->handler);
+ return platform_profile_register(&tpd->handler, NULL);
}
static void surface_platform_profile_remove(struct ssam_device *sdev)
@@ -1928,7 +1928,7 @@ static int acer_platform_profile_setup(struct platform_device *device)
platform_profile_handler.ops =
&acer_predator_v4_platform_profile_ops;
- err = platform_profile_register(&platform_profile_handler);
+ err = platform_profile_register(&platform_profile_handler, NULL);
if (err)
return err;
@@ -425,7 +425,7 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev)
dev->pprof.ops = &amd_pmf_profile_ops;
/* Create platform_profile structure and register */
- err = platform_profile_register(&dev->pprof);
+ err = platform_profile_register(&dev->pprof, NULL);
if (err)
dev_err(dev->dev, "Failed to register SPS support, this is most likely an SBIOS bug: %d\n",
err);
@@ -3895,7 +3895,7 @@ static int platform_profile_setup(struct asus_wmi *asus)
asus->platform_profile_handler.dev = dev;
asus->platform_profile_handler.ops = &asus_wmi_platform_profile_ops;
- err = platform_profile_register(&asus->platform_profile_handler);
+ err = platform_profile_register(&asus->platform_profile_handler, NULL);
if (err == -EEXIST) {
pr_warn("%s, a platform_profile handler is already registered\n", __func__);
return 0;
@@ -1169,7 +1169,7 @@ static int create_thermal_profile(struct platform_device *platform_device)
pp_handler.dev = &platform_device->dev;
pp_handler.ops = &awcc_platform_profile_ops;
- return devm_platform_profile_register(&pp_handler);
+ return devm_platform_profile_register(&pp_handler, NULL);
}
static int __init alienware_wmi_init(void)
@@ -281,7 +281,7 @@ static int thermal_init(void)
thermal_handler->ops = &dell_pc_platform_profile_ops;
/* Clean up if failed */
- ret = platform_profile_register(thermal_handler);
+ ret = platform_profile_register(thermal_handler, NULL);
if (ret)
goto cleanup_thermal_handler;
@@ -1652,7 +1652,7 @@ static int thermal_profile_setup(struct platform_device *device)
platform_profile_handler.name = "hp-wmi";
platform_profile_handler.dev = &device->dev;
- err = platform_profile_register(&platform_profile_handler);
+ err = platform_profile_register(&platform_profile_handler, NULL);
if (err)
return err;
@@ -1123,7 +1123,7 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv)
priv->dytc->pprof.ops = &dytc_profile_ops;
/* Create platform_profile structure and register */
- err = platform_profile_register(&priv->dytc->pprof);
+ err = platform_profile_register(&priv->dytc->pprof, NULL);
if (err)
goto pp_reg_failed;
@@ -196,7 +196,7 @@ static int inspur_wmi_probe(struct wmi_device *wdev, const void *context)
priv->handler.dev = &wdev->dev;
priv->handler.ops = &inspur_platform_profile_ops;
- return platform_profile_register(&priv->handler);
+ return platform_profile_register(&priv->handler, NULL);
}
static void inspur_wmi_remove(struct wmi_device *wdev)
@@ -10649,7 +10649,7 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
dytc_profile.dev = &tpacpi_pdev->dev;
/* Create platform_profile structure and register */
- err = platform_profile_register(&dytc_profile);
+ err = platform_profile_register(&dytc_profile, NULL);
/*
* If for some reason platform_profiles aren't enabled
* don't quit terminally.
@@ -47,9 +47,9 @@ struct platform_profile_handler {
const struct platform_profile_ops *ops;
};
-int platform_profile_register(struct platform_profile_handler *pprof);
+int platform_profile_register(struct platform_profile_handler *pprof, void *drvdata);
int platform_profile_remove(struct platform_profile_handler *pprof);
-int devm_platform_profile_register(struct platform_profile_handler *pprof);
+int devm_platform_profile_register(struct platform_profile_handler *pprof, void *drvdata);
int platform_profile_cycle(void);
void platform_profile_notify(struct platform_profile_handler *pprof);
Add *drvdata to platform_profile_register() signature and assign it to the class device. Signed-off-by: Kurt Borja <kuurtb@gmail.com> --- drivers/acpi/platform_profile.c | 7 ++++--- drivers/platform/surface/surface_platform_profile.c | 2 +- drivers/platform/x86/acer-wmi.c | 2 +- drivers/platform/x86/amd/pmf/sps.c | 2 +- drivers/platform/x86/asus-wmi.c | 2 +- drivers/platform/x86/dell/alienware-wmi.c | 2 +- drivers/platform/x86/dell/dell-pc.c | 2 +- drivers/platform/x86/hp/hp-wmi.c | 2 +- drivers/platform/x86/ideapad-laptop.c | 2 +- drivers/platform/x86/inspur_platform_profile.c | 2 +- drivers/platform/x86/thinkpad_acpi.c | 2 +- include/linux/platform_profile.h | 4 ++-- 12 files changed, 16 insertions(+), 15 deletions(-)