Skip to content

Commit

Permalink
video/sticore: Store ROM device in STI struct
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Zimmermann authored and Helge Deller committed Jan 12, 2024
1 parent 33cd6ea commit 12b8de5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/video/sticore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions include/video/sticore.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef STICORE_H
#define STICORE_H

struct device;
struct fb_info;

/* generic STI structures & functions */
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 12b8de5

Please sign in to comment.