Hi,
I'm trying to run
a code example from the book "Essential Linux Device Drivers". It's a driver module that's supposed to access the CMOS memory banks (port 0x70). Inserting the module fails with -EIO, which is caused by the following section of the code:
Code:
/* Request I/O region */
sprintf(cmos_devp[i]->name, "cmos%d", i);
if (!(request_region(addrports[i], 2, cmos_devp[i]->name))) {
printk("cmos: I/O port 0x%x is not free.\n", addrports[i]);
return -EIO;
}
My guess is that this fails because the memory region has been reserved already by the RTC driver (?). How can I fix the code? I'm using kernel version 3.2.46, the book code was written for a 2.6 kernel. I had to make some minor changes to get the code compiled.
Many thanks!