Commit f4ae2e96 authored by Armin Wolf's avatar Armin Wolf Committed by Hans de Goede

platform/x86: wmi-bmof: Use device_create_bin_file()

Use device_create_bin_file() instead of sysfs_create_bin_file()
to avoid having to access the device kobject.

Tested on a ASUS PRIME B650-PLUS.
Reviewed-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Tested-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarArmin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230730204550.3402-1-W_Armin@gmx.deReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 17ffe3a0
......@@ -75,7 +75,7 @@ static int wmi_bmof_probe(struct wmi_device *wdev, const void *context)
priv->bmof_bin_attr.read = read_bmof;
priv->bmof_bin_attr.size = priv->bmofdata->buffer.length;
ret = sysfs_create_bin_file(&wdev->dev.kobj, &priv->bmof_bin_attr);
ret = device_create_bin_file(&wdev->dev, &priv->bmof_bin_attr);
if (ret)
goto err_free;
......@@ -90,7 +90,7 @@ static void wmi_bmof_remove(struct wmi_device *wdev)
{
struct bmof_priv *priv = dev_get_drvdata(&wdev->dev);
sysfs_remove_bin_file(&wdev->dev.kobj, &priv->bmof_bin_attr);
device_remove_bin_file(&wdev->dev, &priv->bmof_bin_attr);
kfree(priv->bmofdata);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment