patch-2.3.41 linux/drivers/block/buddha.c
Next file: linux/drivers/block/cmd64x.c
Previous file: linux/drivers/block/amiflop.c
Back to the patch index
Back to the overall index
- Lines: 45
- Date:
Wed Jan 26 12:45:20 2000
- Orig file:
v2.3.40/linux/drivers/block/buddha.c
- Orig date:
Thu May 13 11:04:54 1999
diff -u --recursive --new-file v2.3.40/linux/drivers/block/buddha.c linux/drivers/block/buddha.c
@@ -111,24 +111,28 @@
static int find_buddha(void)
{
- u_int key;
- const struct ConfigDev *cd;
+ struct zorro_dev *z = NULL;
buddha_num_hwifs = 0;
- if ((key = zorro_find(ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA, 0, 0)))
- buddha_num_hwifs = BUDDHA_NUM_HWIFS;
- else if ((key = zorro_find(ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL, 0,
- 0)))
- buddha_num_hwifs = CATWEASEL_NUM_HWIFS;
- if (key) {
- cd = zorro_get_board(key);
- buddha_board = (u_long)cd->cd_BoardAddr;
- if (buddha_board) {
- buddha_board = ZTWO_VADDR(buddha_board);
- /* write to BUDDHA_IRQ_MR to enable the board IRQ */
- *(char *)(buddha_board+BUDDHA_IRQ_MR) = 0;
- zorro_config_board(key, 0);
- }
+ while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+ unsigned long board;
+ const char *name;
+ if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
+ buddha_num_hwifs = BUDDHA_NUM_HWIFS;
+ name = "Buddha IDE Interface";
+ } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL) {
+ buddha_num_hwifs = CATWEASEL_NUM_HWIFS;
+ name = "Catweasel IDE Interface and Floppy Controller";
+ } else
+ continue;
+ board = z->resource.start;
+ if (!request_mem_region(board+BUDDHA_BASE1, 0x800, "IDE"))
+ continue;
+ strcpy(z->name, name);
+ buddha_board = ZTWO_VADDR(board);
+ /* write to BUDDHA_IRQ_MR to enable the board IRQ */
+ *(char *)(buddha_board+BUDDHA_IRQ_MR) = 0;
+ break;
}
return buddha_num_hwifs;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)