From: Kronos <kronos@people.it>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: adaplas@pol.net
Subject: Re: [PATCH] Re: Devices don't get linked to their class.
Date: Tue, 7 Sep 2004 21:50:55 +0200 [thread overview]
Message-ID: <20040907195055.GB6021@dreamland.darkstar.lan> (raw)
In-Reply-To: <1094441896.19674.24.camel@laptop.cunninghams>
Il Mon, Sep 06, 2004 at 01:38:16PM +1000, Nigel Cunningham ha scritto:
> On Sun, 2004-09-05 at 20:40, Antonino A. Daplas wrote:
> > Frankly, I don't know a thing about this stuff. Just let me know what you
> > need and where you need them, and I'll see what I can do.
>
> It did turn out to just need the dev parameter to be non null. I've gone
> through all the frame buffer drivers and done what I believe to be the
> right thing; if they're PCI based, they get the struct device pointer
> passed through, otherwise NULL is sent.
>
> The attached patch is against 2.6.9-rc1, and (combined with other code)
> allows the driver to remain active while we're suspending to disk.
There's framebuffer_alloc for that. I forgot to re-add a struct device *
to fb_info after I added the class_simple stuff:
--- a/drivers/video/fbsysfs.c 2004-02-15 15:51:52.000000000 +0100
+++ b/drivers/video/fbsysfs.c 2004-09-07 21:47:07.000000000 +0200
@@ -47,6 +47,7 @@
return NULL;
memset(p, 0, fb_info_size + size);
info = (struct fb_info *) p;
+ info->device = dev;
if (size)
info->par = p + fb_info_size;
--- a/drivers/video/fbmem.c 2004-08-14 20:46:08.000000000 +0200
+++ b/drivers/video/fbmem.c 2004-09-07 21:48:00.000000000 +0200
@@ -1380,7 +1380,7 @@
break;
fb_info->node = i;
- c = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i), NULL, "fb%d", i);
+ c = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i), fb_info->device, "fb%d", i);
if (IS_ERR(c)) {
/* Not fatal */
printk(KERN_WARNING "Unable to create class_device for framebuffer %d; errno = %ld\n", i, PTR_ERR(c));
--- a/include/linux/fb.h 2004-08-14 20:46:19.000000000 +0200
+++ b/include/linux/fb.h 2004-09-07 21:48:53.000000000 +0200
@@ -588,6 +588,7 @@
#define FBINFO_STATE_RUNNING 0
#define FBINFO_STATE_SUSPENDED 1
u32 state; /* Hardware state i.e suspend */
+ struct device *device;
/* From here on everything is device dependent */
void *par;
Luca
--
Home: http://kronoz.cjb.net
Recursion n.:
See Recursion.
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
next prev parent reply other threads:[~2004-09-07 19:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-03 5:02 Devices don't get linked to their class Nigel Cunningham
2004-09-04 12:41 ` Antonino A. Daplas
2004-09-05 6:21 ` Nigel Cunningham
2004-09-05 10:40 ` Antonino A. Daplas
2004-09-05 21:45 ` Nigel Cunningham
2004-09-06 3:38 ` [PATCH] " Nigel Cunningham
[not found] ` <32016.10.250.10.1.1094456212.squirrel@sq04.pol.net>
2004-09-06 21:56 ` Nigel Cunningham
2004-09-07 19:50 ` Kronos [this message]
2004-09-08 0:55 ` Antonino A. Daplas
2004-09-08 3:21 ` Nigel Cunningham
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=20040907195055.GB6021@dreamland.darkstar.lan \
--to=kronos@people.it \
--cc=adaplas@pol.net \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/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).