git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
char
/
lcd.c
diff --git
a/drivers/char/lcd.c
b/drivers/char/lcd.c
index
cf01a72
..
d649abb
100644
(file)
--- a/
drivers/char/lcd.c
+++ b/
drivers/char/lcd.c
@@
-14,7
+14,6
@@
#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */
#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */
-#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
@@
-460,7
+459,7
@@
static int lcd_ioctl(struct inode *inode, struct file *file,
(&display, (struct lcd_display *) arg,
sizeof(struct lcd_display)))
return -EFAULT;
(&display, (struct lcd_display *) arg,
sizeof(struct lcd_display)))
return -EFAULT;
- rom =
(unsigned char *)
kmalloc((128), GFP_ATOMIC);
+ rom = kmalloc((128), GFP_ATOMIC);
if (rom == NULL) {
printk(KERN_ERR LCD "kmalloc() failed in %s\n",
__FUNCTION__);
if (rom == NULL) {
printk(KERN_ERR LCD "kmalloc() failed in %s\n",
__FUNCTION__);
@@
-575,8
+574,8
@@
static inline int button_pressed(void)
static int lcd_waiters = 0;
static int lcd_waiters = 0;
-static
long lcd_read(struct inode *inode,
struct file *file, char *buf,
-
unsigned long count
)
+static
ssize_t lcd_read(
struct file *file, char *buf,
+
size_t count, loff_t *ofs
)
{
long buttons_now;
{
long buttons_now;
@@
-599,7
+598,7
@@
static long lcd_read(struct inode *inode, struct file *file, char *buf,
* The various file operations we support.
*/
* The various file operations we support.
*/
-static struct file_operations lcd_fops = {
+static
const
struct file_operations lcd_fops = {
.read = lcd_read,
.ioctl = lcd_ioctl,
.open = lcd_open,
.read = lcd_read,
.ioctl = lcd_ioctl,
.open = lcd_open,
@@
-613,10
+612,15
@@
static struct miscdevice lcd_dev = {
static int lcd_init(void)
{
static int lcd_init(void)
{
+ int ret;
unsigned long data;
pr_info("%s\n", LCD_DRIVER);
unsigned long data;
pr_info("%s\n", LCD_DRIVER);
- misc_register(&lcd_dev);
+ ret = misc_register(&lcd_dev);
+ if (ret) {
+ printk(KERN_WARNING LCD "Unable to register misc device.\n");
+ return ret;
+ }
/* Check region? Naaah! Just snarf it up. */
/* request_region(RTC_PORT(0), RTC_IO_EXTENT, "lcd");*/
/* Check region? Naaah! Just snarf it up. */
/* request_region(RTC_PORT(0), RTC_IO_EXTENT, "lcd");*/