Thread (9 messages) 9 messages, 3 authors, 2004-09-08

Re: [PATCH] Re: Devices don't get linked to their class.

From: Kronos <hidden>
Date: 2004-09-07 19:51:05

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:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help