]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
video/sticore: Store ROM device in STI struct
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 20 Dec 2023 13:22:54 +0000 (14:22 +0100)
committerHelge Deller <deller@gmx.de>
Fri, 12 Jan 2024 11:38:37 +0000 (12:38 +0100)
Store the ROM's parent device in each STI struct, so we can associate
the STI framebuffer with a device.

The new field will eventually replace the fbdev subsystem's info field,
which the function fb_is_primary_device() currently requires to detect
the firmware's output. By using the device instead of the framebuffer
info, a later patch can generalize the helper for use in non-fbdev code.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/sticore.c
include/video/sticore.h

index c3765ad6eedfe8a4907ae2d9c82e65f8a560c3d8..7115b325817f621d54e7ead9432cbbd7674aca39 100644 (file)
@@ -1041,6 +1041,9 @@ static int __init sticore_pa_init(struct parisc_device *dev)
 
        print_pa_hwpath(dev, sti->pa_path);
        sticore_check_for_default_sti(sti, sti->pa_path);
+
+       sti->dev = &dev->dev;
+
        return 0;
 }
 
@@ -1084,6 +1087,8 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent)
                pr_warn("Unable to handle STI device '%s'\n", pci_name(pd));
                return -ENODEV;
        }
+
+       sti->dev = &pd->dev;
 #endif /* CONFIG_PCI */
 
        return 0;
index 012b5b46ad7d0b3f58287aa595d6749270d709d0..9d993e22805da28165b8f8a6edea14ada6876ad2 100644 (file)
@@ -2,6 +2,7 @@
 #ifndef STICORE_H
 #define STICORE_H
 
+struct device;
 struct fb_info;
 
 /* generic STI structures & functions */
@@ -370,6 +371,9 @@ struct sti_struct {
        /* pointer to the fb_info where this STI device is used */
        struct fb_info *info;
 
+       /* pointer to the parent device */
+       struct device *dev;
+
        /* pointer to all internal data */
        struct sti_all_data *sti_data;