Skip to content

Commit 12b8de5

Browse files
tdzhdeller
authored andcommitted
video/sticore: Store ROM device in STI struct
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>
1 parent 33cd6ea commit 12b8de5

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/video/sticore.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,9 @@ static int __init sticore_pa_init(struct parisc_device *dev)
10411041

10421042
print_pa_hwpath(dev, sti->pa_path);
10431043
sticore_check_for_default_sti(sti, sti->pa_path);
1044+
1045+
sti->dev = &dev->dev;
1046+
10441047
return 0;
10451048
}
10461049

@@ -1084,6 +1087,8 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent)
10841087
pr_warn("Unable to handle STI device '%s'\n", pci_name(pd));
10851088
return -ENODEV;
10861089
}
1090+
1091+
sti->dev = &pd->dev;
10871092
#endif /* CONFIG_PCI */
10881093

10891094
return 0;

include/video/sticore.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#ifndef STICORE_H
33
#define STICORE_H
44

5+
struct device;
56
struct fb_info;
67

78
/* generic STI structures & functions */
@@ -370,6 +371,9 @@ struct sti_struct {
370371
/* pointer to the fb_info where this STI device is used */
371372
struct fb_info *info;
372373

374+
/* pointer to the parent device */
375+
struct device *dev;
376+
373377
/* pointer to all internal data */
374378
struct sti_all_data *sti_data;
375379

0 commit comments

Comments
 (0)