mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 1/3] platform/x86: wmi-bmof: Use device_create_bin_file()
@ 2023-07-30 20:45 Armin Wolf
  2023-07-30 20:45 ` [PATCH v3 2/3] platform/x86: wmi-bmof: Simplify read_bmof() Armin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Armin Wolf @ 2023-07-30 20:45 UTC (permalink / raw)
  To: hdegoede, markgross, thomas; +Cc: platform-driver-x86, linux-kernel

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: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
Changes since v1:
- add Reviewed-by and Tested-by tags
---
 drivers/platform/x86/wmi-bmof.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/wmi-bmof.c b/drivers/platform/x86/wmi-bmof.c
index 80137afb9753..d0516cacfcb5 100644
--- a/drivers/platform/x86/wmi-bmof.c
+++ b/drivers/platform/x86/wmi-bmof.c
@@ -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);
 }

--
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-31 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30 20:45 [PATCH v3 1/3] platform/x86: wmi-bmof: Use device_create_bin_file() Armin Wolf
2023-07-30 20:45 ` [PATCH v3 2/3] platform/x86: wmi-bmof: Simplify read_bmof() Armin Wolf
2023-07-30 20:45 ` [PATCH v3 3/3] platform/x86: wmi-bmof: Update MAINTAINERS entry Armin Wolf
2023-07-31 14:09 ` [PATCH v3 1/3] platform/x86: wmi-bmof: Use device_create_bin_file() Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®