fbdev: efifb: Use driver-private screen_info for sysfs
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 27 Aug 2024 15:25:16 +0000 (17:25 +0200)
committerHelge Deller <deller@gmx.de>
Fri, 30 Aug 2024 16:42:38 +0000 (18:42 +0200)
Since commit b9cfd1d271ab ("fbdev/efifb: Use screen_info pointer from device")
efifb uses a local copy of screen_info and applies its modifications
there. Adapt the sysfs attributes to also work with the custom copy
instead of the unmodified platform data.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/efifb.c

index ee71a65b361d5b9e72dcdee1333624cbd7477887..20517448487e733edc217c3ed5c995d232be49a5 100644 (file)
@@ -322,7 +322,7 @@ static ssize_t name##_show(struct device *dev,                              \
                           struct device_attribute *attr,               \
                           char *buf)                                   \
 {                                                                      \
-       struct screen_info *si = dev_get_platdata(dev);                 \
+       struct screen_info *si = dev_get_drvdata(dev);                  \
        if (!si)                                                        \
                return -ENODEV;                                         \
        return sprintf(buf, fmt "\n", (si->lfb_##name));                \
@@ -369,6 +369,8 @@ static int efifb_probe(struct platform_device *dev)
        if (!si)
                return -ENOMEM;
 
+       dev_set_drvdata(&dev->dev, si);
+
        if (si->orig_video_isVGA != VIDEO_TYPE_EFI)
                return -ENODEV;