From: Thomas Zimmermann <tzimmermann@suse.de>
To: deller@gmx.de, James.Bottomley@HansenPartnership.com, arnd@arndb.de
Cc: linux-parisc@vger.kernel.org, linux-fbdev@vger.kernel.org,
dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 1/4] video/sticore: Store ROM device in STI struct
Date: Wed, 20 Dec 2023 14:22:54 +0100 [thread overview]
Message-ID: <20231220134639.8190-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20231220134639.8190-1-tzimmermann@suse.de>
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>
---
drivers/video/sticore.c | 5 +++++
include/video/sticore.h | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/drivers/video/sticore.c b/drivers/video/sticore.c
index c3765ad6eedf..7115b325817f 100644
--- a/drivers/video/sticore.c
+++ b/drivers/video/sticore.c
@@ -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;
diff --git a/include/video/sticore.h b/include/video/sticore.h
index 012b5b46ad7d..9d993e22805d 100644
--- a/include/video/sticore.h
+++ b/include/video/sticore.h
@@ -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;
--
2.43.0
next prev parent reply other threads:[~2023-12-20 13:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 13:22 [PATCH 0/4] arch/parisc: Detect primary framebuffer from device Thomas Zimmermann
2023-12-20 13:22 ` Thomas Zimmermann [this message]
2024-01-02 12:06 ` [PATCH 1/4] video/sticore: Store ROM device in STI struct Helge Deller
2023-12-20 13:22 ` [PATCH 2/4] fbdev/stifb: Allocate fb_info instance with framebuffer_alloc() Thomas Zimmermann
2023-12-30 8:35 ` Helge Deller
2024-01-02 8:04 ` Thomas Zimmermann
2023-12-20 13:22 ` [PATCH 3/4] arch/parisc: Detect primary video device from device instance Thomas Zimmermann
2023-12-20 13:22 ` [PATCH 4/4] video/sticore: Remove info field from STI struct Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231220134639.8190-2-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=arnd@arndb.de \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).