Thread (5 messages) 5 messages, 2 authors, 2004-06-16

Re: [PATCH][RFC][3/3] mode attribute in sysfs tree

flat view

From: Kronos <hidden>
Date: 2004-06-16 09:32:01

Simple patch to show usage of the attribute with sisfb.

diff -Nru -X dontdiff linux-2.6-vanilla/drivers/video/sis/sis_main.c linux-2.6/drivers/video/sis/sis_main.c
--- linux-2.6-vanilla/drivers/video/sis/sis_main.c	2004-02-28 13:32:58.000000000 +0100
+++ linux-2.6/drivers/video/sis/sis_main.c	2004-06-12 19:21:06.000000000 +0200
@@ -4102,7 +4102,9 @@
         return NULL;
 }
 
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,7)
+static FB_MODE_ATTR(sis_mode_attr);
+#endif
 
 int __init sisfb_init(void)
 {
@@ -4954,6 +4956,9 @@
 			kfree(sis_fb_info);
 			return -EINVAL;
 		}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,7)
+		class_device_create_file(sis_fb_info->class_dev, &sis_mode_attr);
+#endif
 
 		sisfb_registered = 1;			
 
@@ -5266,6 +5271,9 @@
 	/* Unregister the framebuffer */
 	if(sisfb_registered) {
 		unregister_framebuffer(sis_fb_info);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,7)
+		class_device_remove_file(sis_fb_info->class_dev, &sis_mode_attr);
+#endif
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (defined(NEWFBDEV))
 		framebuffer_release(sis_fb_info);
 #else

Luca
-- 
Home: http://kronoz.cjb.net
Collect some stars to shine for you
And start today 'cause there's only a few
A sign of times my friend


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help