source "drivers/block/Kconfig"
 
+# misc before ide - BLK_DEV_SGIIOC4 depends on SGI_IOC4
+
+source "drivers/misc/Kconfig"
+
 source "drivers/ide/Kconfig"
 
 source "drivers/scsi/Kconfig"
 
 source "drivers/hwmon/Kconfig"
 
-source "drivers/misc/Kconfig"
-
 source "drivers/mfd/Kconfig"
 
 source "drivers/media/Kconfig"
 
        ioc4_unregister_submodule(&ioc4_ide_submodule);
 }
 
-module_init(ioc4_ide_init);
+late_initcall(ioc4_ide_init); /* Call only after IDE init is done */
 module_exit(ioc4_ide_exit);
 
 MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon");
 
 
          If unsure, say N.
 
+config SGI_IOC4
+       tristate "SGI IOC4 Base IO support"
+       ---help---
+         This option enables basic support for the IOC4 chip on certain
+         SGI IO controller cards (IO9, IO10, and PCI-RT).  This option
+         does not enable any specific functions on such a card, but provides
+         necessary infrastructure for other drivers to utilize.
+
+         If you have an SGI Altix with an IOC4-based card say Y.
+         Otherwise say N.
+
 config TIFM_CORE
        tristate "TI Flash Media interface support (EXPERIMENTAL)"
        depends on EXPERIMENTAL
 
 obj-$(CONFIG_LKDTM)            += lkdtm.o
 obj-$(CONFIG_TIFM_CORE)        += tifm_core.o
 obj-$(CONFIG_TIFM_7XX1)        += tifm_7xx1.o
+obj-$(CONFIG_SGI_IOC4)         += ioc4.o
 
 #include <linux/ktime.h>
 #include <linux/mutex.h>
 #include <linux/time.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/clksupport.h>
-#include <asm/sn/shub_mmr.h>
 
 /***************
  * Definitions *
                       IOC4_CALIBRATE_DEFAULT / IOC4_EXTINT_COUNT_DIVISOR);
                period = IOC4_CALIBRATE_DEFAULT;
        } else {
+               u64 ns = period;
+
+               do_div(ns, IOC4_EXTINT_COUNT_DIVISOR);
                printk(KERN_DEBUG
-                      "IOC4 %s: PCI clock is %ld ns.\n",
-                      pci_name(idd->idd_pdev),
-                      period / IOC4_EXTINT_COUNT_DIVISOR);
+                      "IOC4 %s: PCI clock is %lld ns.\n",
+                      pci_name(idd->idd_pdev), ns);
        }
 
        /* Remember results.  We store the extint clock period rather
 
        uart_unregister_driver(&ioc4_uart_rs422);
 }
 
-module_init(ioc4_serial_init);
+late_initcall(ioc4_serial_init); /* Call only after tty init is done */
 module_exit(ioc4_serial_exit);
 
 MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>");
 
 menu "SN Devices"
        depends on SGI_SN
 
-config SGI_IOC4
-       tristate "SGI IOC4 Base IO support"
-       default m
-       ---help---
-       This option enables basic support for the IOC4 chip on certain
-       SGI IO controller cards (IO9, IO10, and PCI-RT).  This option
-       does not enable any specific functions on such a card, but provides
-       necessary infrastructure for other drivers to utilize.
-
-       If you have an SGI Altix with an IOC4-based card say Y.
-       Otherwise say N.
-
 config SGI_IOC3
        tristate "SGI IOC3 Base IO support"
        default m
 
 #
 #
 
-obj-$(CONFIG_SGI_IOC4) += ioc4.o
 obj-$(CONFIG_SGI_IOC3) += ioc3.o