static inline void ide_unlock_host(struct ide_host *host) { if (host->host_flags & IDE_HFLAG_SERIALIZE) { /* for atari only */ ide_release_lock(); clear_bit_unlock(IDE_HOST_BUSY, &host->host_busy); } }
static int __init falconide_init(void) { struct ide_host *host; hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; int rc; if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) return -ENODEV; printk(KERN_INFO "ide: Falcon IDE controller\n"); if (!request_mem_region(ATA_HD_BASE, 0x40, DRV_NAME)) { printk(KERN_ERR "%s: resources busy\n", DRV_NAME); return -EBUSY; } falconide_setup_ports(&hw); host = ide_host_alloc(&falconide_port_info, hws); if (host == NULL) { rc = -ENOMEM; goto err; } ide_get_lock(NULL, NULL); rc = ide_host_register(host, &falconide_port_info, hws); ide_release_lock(); if (rc) goto err_free; return 0; err_free: ide_host_free(host); err: release_mem_region(ATA_HD_BASE, 0x40); return rc; }