/*
* Open the device; all we have to do here is to up the usage count and
* set the right fops.
*/
int simple_open (struct inode *inode, struct file *filp)
{
unsigned int dev = MINOR(inode->i_rdev);
/*
* Module housekeeping.
*/
static int simple_init(void)
{
int result;
SET_MODULE_OWNER(&simple_nopage_ops);
result = register_chrdev(simple_major, "simple", &simple_nopage_ops);
if (result < 0)
{
printk(KERN_WARNING "simple: unable to get major %d\n", simple_major);
return result;
}
int index = 0;
for(; index < 4096 * 2; index++)
buff[index] = 'a' + index % 26;
if (simple_major == 0)
simple_major = result;
return 0;
}