]> Git Repo - linux.git/commitdiff
firmware: google: memconsole: Use const 'struct bin_attribute' callback
authorThomas Weißschuh <[email protected]>
Sun, 15 Dec 2024 14:49:11 +0000 (15:49 +0100)
committerTzung-Bi Shih <[email protected]>
Tue, 17 Dec 2024 03:59:31 +0000 (03:59 +0000)
The sysfs core now provides callback variants that explicitly take a
const pointer. Use them so the non-const variants can be removed.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Brian Norris <[email protected]>
Link: https://lore.kernel.org/r/20241215-sysfs-const-bin_attr-google-v1-3-e5c2808f5833@weissschuh.net
Signed-off-by: Tzung-Bi Shih <[email protected]>
drivers/firmware/google/memconsole.c

index b9d99fe1ff0f683f9fff3c4bc669d2a85c703366..d957af6f934984b74627e83f458575dbf2b7d592 100644 (file)
@@ -14,7 +14,7 @@
 #include "memconsole.h"
 
 static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
-                              struct bin_attribute *bin_attr, char *buf,
+                              const struct bin_attribute *bin_attr, char *buf,
                               loff_t pos, size_t count)
 {
        ssize_t (*memconsole_read_func)(char *, loff_t, size_t);
@@ -28,7 +28,7 @@ static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
 
 static struct bin_attribute memconsole_bin_attr = {
        .attr = {.name = "log", .mode = 0444},
-       .read = memconsole_read,
+       .read_new = memconsole_read,
 };
 
 void memconsole_setup(ssize_t (*read_func)(char *, loff_t, size_t))
This page took 0.047539 seconds and 4 git commands to generate.