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 kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
parisc
/
eisa_eeprom.c
diff --git
a/drivers/parisc/eisa_eeprom.c
b/drivers/parisc/eisa_eeprom.c
index
d16724d
..
e13aafa
100644
(file)
--- a/
drivers/parisc/eisa_eeprom.c
+++ b/
drivers/parisc/eisa_eeprom.c
@@
-19,7
+19,6
@@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@
-32,8
+31,6
@@
#define EISA_EEPROM_MINOR 241
#define EISA_EEPROM_MINOR 241
-static unsigned long eeprom_addr;
-
static loff_t eisa_eeprom_llseek(struct file *file, loff_t offset, int origin )
{
switch (origin) {
static loff_t eisa_eeprom_llseek(struct file *file, loff_t offset, int origin )
{
switch (origin) {
@@
-51,7
+48,7
@@
static loff_t eisa_eeprom_llseek(struct file *file, loff_t offset, int origin )
}
static ssize_t eisa_eeprom_read(struct file * file,
}
static ssize_t eisa_eeprom_read(struct file * file,
- char *buf, size_t count, loff_t *ppos )
+ char
__user
*buf, size_t count, loff_t *ppos )
{
unsigned char *tmp;
ssize_t ret;
{
unsigned char *tmp;
ssize_t ret;
@@
-64,7
+61,7
@@
static ssize_t eisa_eeprom_read(struct file * file,
tmp = kmalloc(count, GFP_KERNEL);
if (tmp) {
for (i = 0; i < count; i++)
tmp = kmalloc(count, GFP_KERNEL);
if (tmp) {
for (i = 0; i < count; i++)
- tmp[i] =
gsc_readb(
eeprom_addr+(*ppos)++);
+ tmp[i] =
readb(eisa_
eeprom_addr+(*ppos)++);
if (copy_to_user (buf, tmp, count))
ret = -EFAULT;
if (copy_to_user (buf, tmp, count))
ret = -EFAULT;
@@
-86,7
+83,7
@@
static int eisa_eeprom_ioctl(struct inode *inode, struct file *file,
static int eisa_eeprom_open(struct inode *inode, struct file *file)
{
static int eisa_eeprom_open(struct inode *inode, struct file *file)
{
- if (file->f_mode & 2
|| eeprom_addr == 0
)
+ if (file->f_mode & 2)
return -EINVAL;
return 0;
return -EINVAL;
return 0;
@@
-109,22
+106,18
@@
static struct file_operations eisa_eeprom_fops = {
.release = eisa_eeprom_release,
};
.release = eisa_eeprom_release,
};
-static struct miscdevice eisa_eeprom_dev=
-{
+static struct miscdevice eisa_eeprom_dev = {
EISA_EEPROM_MINOR,
EISA_EEPROM_MINOR,
- "eisa
eeprom",
+ "eisa
_
eeprom",
&eisa_eeprom_fops
};
&eisa_eeprom_fops
};
-
int __init eisa_eeprom_init(unsigned long addr
)
+
static int __init eisa_eeprom_init(void
)
{
int retval;
{
int retval;
- /* XXX why return success when we haven't done anything? */
- if (!addr)
- return 0;
-
- eeprom_addr = addr;
+ if (!eisa_eeprom_addr)
+ return -ENODEV;
retval = misc_register(&eisa_eeprom_dev);
if (retval < 0) {
retval = misc_register(&eisa_eeprom_dev);
if (retval < 0) {
@@
-132,8
+125,10
@@
int __init eisa_eeprom_init(unsigned long addr)
return retval;
}
return retval;
}
- printk(KERN_INFO "EISA EEPROM at 0x%
lx\n",
eeprom_addr);
+ printk(KERN_INFO "EISA EEPROM at 0x%
p\n", eisa_
eeprom_addr);
return 0;
}
MODULE_LICENSE("GPL");
return 0;
}
MODULE_LICENSE("GPL");
+
+module_init(eisa_eeprom_init);