public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH update7] drivers: add LCD support
@ 2006-11-06 20:24 Miguel Ojeda Sandonis
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda Sandonis @ 2006-11-06 20:24 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Andrew, 3 improvements for the drivers-add-lcd-support saga. Thanks you.
---

 - use the new and simpler vm_insert_page()
     instead of nopage() related code
 - cfag12864b_work can and should be static
 - minor spelling and coding style

 drivers/auxdisplay/cfag12864b.c   |   11 +++++------
 drivers/auxdisplay/cfag12864bfb.c |   21 ++-------------------
 2 files changed, 7 insertions(+), 25 deletions(-)

drivers-add-lcd-support-update-7.patch
Signed-off-by: Miguel Ojeda Sandonis <maxextreme@gmail.com>
---
diff -uprN -X dontdiff linux-mod4/drivers/auxdisplay/cfag12864b.c linux/drivers/auxdisplay/cfag12864b.c
--- linux-mod4/drivers/auxdisplay/cfag12864b.c	2006-11-01 19:49:47.000000000 +0000
+++ linux/drivers/auxdisplay/cfag12864b.c	2006-11-06 20:02:07.000000000 +0000
@@ -63,10 +63,10 @@ unsigned int cfag12864b_getrate(void)
  *		cfag12864b/ks0108 reads the command/data.
  *
  *	CS1 = First ks0108controller.
- *		If high, the first ks0108 receives commands/data.
+ *		If high, the first ks0108 controller receives commands/data.
  *
  *	CS2 = Second ks0108 controller
- *		If high, the second ks0108 receives commands/data.
+ *		If high, the second ks0108 controller receives commands/data.
  *
  *	DI = Data/Instruction
  *		If low, cfag12864b will expect commands.
@@ -223,7 +223,7 @@ static DEFINE_MUTEX(cfag12864b_mutex);
 static unsigned char cfag12864b_updating;
 static void cfag12864b_update(void *arg);
 static struct workqueue_struct *cfag12864b_workqueue;
-DECLARE_WORK(cfag12864b_work, cfag12864b_update, NULL);
+static DECLARE_WORK(cfag12864b_work, cfag12864b_update, NULL);
 
 static void cfag12864b_queue(void)
 {
@@ -241,8 +241,7 @@ unsigned char cfag12864b_enable(void)
 		cfag12864b_updating = 1;
 		cfag12864b_queue();
 		ret = 0;
-	}
-	else
+	} else
 		ret = 1;
 
 	mutex_unlock(&cfag12864b_mutex);
@@ -328,7 +327,7 @@ static int __init cfag12864b_init(void)
 		goto none;
 	}
 
-	cfag12864b_buffer = (unsigned char *) __get_free_page(GFP_KERNEL);
+	cfag12864b_buffer = (unsigned char *)__get_free_page(GFP_KERNEL);
 	if (cfag12864b_buffer == NULL) {
 		printk(KERN_ERR CFAG12864B_NAME ": ERROR: "
 			"can't get a free page\n");
diff -uprN -X dontdiff linux-mod4/drivers/auxdisplay/cfag12864bfb.c linux/drivers/auxdisplay/cfag12864bfb.c
--- linux-mod4/drivers/auxdisplay/cfag12864bfb.c	2006-11-01 19:49:47.000000000 +0000
+++ linux/drivers/auxdisplay/cfag12864bfb.c	2006-11-06 20:03:10.000000000 +0000
@@ -65,27 +65,10 @@ static struct fb_var_screeninfo cfag1286
 	.vmode = FB_VMODE_NONINTERLACED,
 };
 
-static struct page *cfag12864bfb_vma_nopage(struct vm_area_struct *vma,
-	unsigned long address, int *type)
-{
-	struct page *page = virt_to_page(cfag12864b_buffer);
-	get_page(page);
-
-	if (type)
-		*type = VM_FAULT_MINOR;
-
-	return page;
-}
-
-static struct vm_operations_struct cfag12864bfb_vm_ops = {
-	.nopage = cfag12864bfb_vma_nopage,
-};
-
 static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
-	vma->vm_ops = &cfag12864bfb_vm_ops;
-	vma->vm_flags |= VM_RESERVED;
-	return 0;
+	return vm_insert_page(vma, vma->vm_start,
+		virt_to_page(cfag12864b_buffer));
 }
 
 static struct fb_ops cfag12864bfb_ops = {

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH update7] drivers: add LCD support
@ 2006-11-05 11:49 Miguel Ojeda Sandonis
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda Sandonis @ 2006-11-05 11:49 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Andrew, 3 minor fixes for the drivers-add-lcd-support saga.
---

 - cfag12864b_work should be static
 - spelling
 - coding style

 drivers/auxdisplay/cfag12864b.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

miguelojeda-drivers-add-LCD-support-7-minor-fixes
Signed-off-by: Miguel Ojeda Sandonis <maxextreme@gmail.com>
---
diff -uprN -X dontdiff linux-mod4/drivers/auxdisplay/cfag12864b.c linux/drivers/auxdisplay/cfag12864b.c
--- linux-mod4/drivers/auxdisplay/cfag12864b.c	2006-11-01 19:49:47.000000000 +0000
+++ linux/drivers/auxdisplay/cfag12864b.c	2006-11-05 11:39:58.000000000 +0000
@@ -63,10 +63,10 @@ unsigned int cfag12864b_getrate(void)
  *		cfag12864b/ks0108 reads the command/data.
  *
  *	CS1 = First ks0108controller.
- *		If high, the first ks0108 receives commands/data.
+ *		If high, the first ks0108 controller receives commands/data.
  *
  *	CS2 = Second ks0108 controller
- *		If high, the second ks0108 receives commands/data.
+ *		If high, the second ks0108 controller receives commands/data.
  *
  *	DI = Data/Instruction
  *		If low, cfag12864b will expect commands.
@@ -223,7 +223,7 @@ static DEFINE_MUTEX(cfag12864b_mutex);
 static unsigned char cfag12864b_updating;
 static void cfag12864b_update(void *arg);
 static struct workqueue_struct *cfag12864b_workqueue;
-DECLARE_WORK(cfag12864b_work, cfag12864b_update, NULL);
+static DECLARE_WORK(cfag12864b_work, cfag12864b_update, NULL);
 
 static void cfag12864b_queue(void)
 {
@@ -241,8 +241,7 @@ unsigned char cfag12864b_enable(void)
 		cfag12864b_updating = 1;
 		cfag12864b_queue();
 		ret = 0;
-	}
-	else
+	} else
 		ret = 1;
 
 	mutex_unlock(&cfag12864b_mutex);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-06 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06 20:24 [PATCH update7] drivers: add LCD support Miguel Ojeda Sandonis
  -- strict thread matches above, loose matches on Subject: below --
2006-11-05 11:49 Miguel Ojeda Sandonis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox