0xE0000
};
-static spinlock_t xd_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xd_lock);
static struct gendisk *xd_gendisk[2];
/* xd_detect: scan the possible BIOS ROM locations for the signature strings */
static u_char __init xd_detect (u_char *controller, unsigned int *address)
{
- u_char i,j,found = 0;
+ int i, j;
if (xd_override)
{
return(1);
}
- for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])) && !found; i++)
- for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])) && !found; j++)
- if (isa_check_signature(xd_bases[i] + xd_sigs[j].offset,xd_sigs[j].string,strlen(xd_sigs[j].string))) {
+ for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])); i++) {
+ void __iomem *p = ioremap(xd_bases[i], 0x2000);
+ if (!p)
+ continue;
+ for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])); j++) {
+ const char *s = xd_sigs[j].string;
+ if (check_signature(p + xd_sigs[j].offset, s, strlen(s))) {
*controller = j;
xd_type = j;
*address = xd_bases[i];
- found++;
+ iounmap(p);
+ return 1;
}
- return (found);
+ }
+ iounmap(p);
+ }
+ return 0;
}
/* do_xd_request: handle an incoming request */
#ifdef MODULE
-MODULE_PARM(xd, "1-4i");
-MODULE_PARM(xd_geo, "3-6i");
-MODULE_PARM(nodma, "i");
+module_param_array(xd, int, NULL, 0);
+module_param_array(xd_geo, int, NULL, 0);
+module_param(nodma, bool, 0);
MODULE_LICENSE("GPL");