Skip to content

Commit c72ca29

Browse files
kuu-rtij-intel
authored andcommitted
platform/x86: inspur_platform_profile: Use devm_platform_profile_register()
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 <[email protected]> Signed-off-by: Kurt Borja <[email protected]> Reviewed-by: Mark Pearson <[email protected]> Tested-by: Mark Pearson <[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]>
1 parent db0c8eb commit c72ca29

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/platform/x86/inspur_platform_profile.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,7 @@ static int inspur_wmi_probe(struct wmi_device *wdev, const void *context)
194194
priv->handler.dev = &wdev->dev;
195195
priv->handler.ops = &inspur_platform_profile_ops;
196196

197-
return platform_profile_register(&priv->handler, priv);
198-
}
199-
200-
static void inspur_wmi_remove(struct wmi_device *wdev)
201-
{
202-
struct inspur_wmi_priv *priv;
203-
204-
priv = dev_get_drvdata(&wdev->dev);
205-
platform_profile_remove(&priv->handler);
197+
return devm_platform_profile_register(&priv->handler, priv);
206198
}
207199

208200
static const struct wmi_device_id inspur_wmi_id_table[] = {
@@ -219,7 +211,6 @@ static struct wmi_driver inspur_wmi_driver = {
219211
},
220212
.id_table = inspur_wmi_id_table,
221213
.probe = inspur_wmi_probe,
222-
.remove = inspur_wmi_remove,
223214
.no_singleton = true,
224215
};
225216

0 commit comments

Comments
 (0)