Skip to content

Commit

Permalink
platform/x86: inspur_platform_profile: Use devm_platform_profile_regi…
Browse files Browse the repository at this point in the history
…ster()

Replace platform_profile_register() with it's device managed version.
While at it, pass inspur_wmi_priv to the class device as drvdata and
replace uses of container_of() with dev_get_drvdata().

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20250116002721.75592-14-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  • Loading branch information
Kurt Borja authored and Ilpo Järvinen committed Jan 17, 2025
1 parent db0c8eb commit c72ca29
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/platform/x86/inspur_platform_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,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, priv);
}

static void inspur_wmi_remove(struct wmi_device *wdev)
{
struct inspur_wmi_priv *priv;

priv = dev_get_drvdata(&wdev->dev);
platform_profile_remove(&priv->handler);
return devm_platform_profile_register(&priv->handler, priv);
}

static const struct wmi_device_id inspur_wmi_id_table[] = {
Expand All @@ -219,7 +211,6 @@ static struct wmi_driver inspur_wmi_driver = {
},
.id_table = inspur_wmi_id_table,
.probe = inspur_wmi_probe,
.remove = inspur_wmi_remove,
.no_singleton = true,
};

Expand Down

0 comments on commit c72ca29

Please sign in to comment.