From: Bob Breuer <breuerr@mc.net>
To: sparclinux@vger.kernel.org
Subject: fix cg14 with serial console
Date: Tue, 01 Feb 2005 04:37:48 +0000 [thread overview]
Message-ID: <41FF079C.7070007@mc.net> (raw)
When booting with a serial console and a vsimm installed, the cg14
driver would crash because the driver failed to check the return
value of prom_getproperty().
Here's a patch to fix that and move the SPARC32 conditional out of
the source file and into Kconfig.
Bob
diff -X dontdiff -urp linux-2.6.10-clean/drivers/video/cg14.c linux-2.6.10/drivers/video/cg14.c
--- linux-2.6.10-clean/drivers/video/cg14.c 2005-01-12 00:11:02.000000000 -0600
+++ linux-2.6.10/drivers/video/cg14.c 2005-01-31 22:31:36.000000000 -0600
@@ -469,9 +469,9 @@ static void cg14_init_one(struct sbus_de
int is_8mb, linebytes, i;
if (!sdev) {
- prom_getproperty(node, "address",
- (char *) &bases[0], sizeof(bases));
- if (!bases[0]) {
+ if (prom_getproperty(node, "address",
+ (char *) &bases[0], sizeof(bases)) <= 0
+ || !bases[0]) {
printk(KERN_ERR "cg14: Device is not mapped.\n");
return;
}
@@ -591,24 +591,20 @@ int __init cg14_init(void)
{
struct sbus_bus *sbus;
struct sbus_dev *sdev;
+ int root, node;
if (fb_get_options("cg14fb", NULL))
return -ENODEV;
-#ifdef CONFIG_SPARC32
- {
- int root, node;
-
- root = prom_getchild(prom_root_node);
- root = prom_searchsiblings(root, "obio");
- if (root) {
- node = prom_searchsiblings(prom_getchild(root),
- "cgfourteen");
- if (node)
- cg14_init_one(NULL, node, root);
- }
+ root = prom_getchild(prom_root_node);
+ root = prom_searchsiblings(root, "obio");
+ if (root) {
+ node = prom_searchsiblings(prom_getchild(root),
+ "cgfourteen");
+ if (node)
+ cg14_init_one(NULL, node, root);
}
-#endif
+
for_all_sbusdev(sdev, sbus) {
if (!strcmp(sdev->prom_name, "cgfourteen"))
cg14_init_one(sdev, sdev->prom_node, sbus->prom_node);
diff -X dontdiff -urp linux-2.6.10-clean/drivers/video/Kconfig linux-2.6.10/drivers/video/Kconfig
--- linux-2.6.10-clean/drivers/video/Kconfig 2005-01-12 00:11:01.000000000 -0600
+++ linux-2.6.10/drivers/video/Kconfig 2005-01-31 22:11:23.000000000 -0600
@@ -954,14 +954,14 @@ config FB_FFB
config FB_TCX
bool "TCX (SS4/SS5 only) support"
- depends on FB_SBUS
+ depends on FB_SBUS && SPARC32
help
This is the frame buffer device driver for the TCX 24/8bit frame
buffer.
config FB_CG14
bool "CGfourteen (SX) support"
- depends on FB_SBUS
+ depends on FB_SBUS && SPARC32
help
This is the frame buffer device driver for the CGfourteen frame
buffer on Desktop SPARCsystems with the SX graphics option.
next reply other threads:[~2005-02-01 4:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-01 4:37 Bob Breuer [this message]
2005-02-01 4:44 ` fix cg14 with serial console David S. Miller
2005-02-05 4:04 ` Bob Breuer
2005-02-05 5:41 ` David S. Miller
2005-02-06 22:23 ` Art Haas
2005-02-15 18:06 ` David S. Miller
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=41FF079C.7070007@mc.net \
--to=breuerr@mc.net \
--cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.