]> git.hungrycats.org Git - linux/commitdiff
[ARM] Update SA1111
authorRussell King <rmk@flint.arm.linux.org.uk>
Thu, 11 Sep 2003 01:08:56 +0000 (02:08 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Thu, 11 Sep 2003 01:08:56 +0000 (02:08 +0100)
Combine the two initialisation functions, allow SA1111 to be built
as a module, and remove a redundant SA1111 function prototype.

arch/arm/common/sa1111.c
include/asm-arm/hardware/sa1111.h

index 4df103ecbf9c5cc0e75b074324c9da34fd5683df..1033d0551552b655259e21668e10fde6a0cac0ab 100644 (file)
@@ -957,17 +957,6 @@ static struct device_driver sa1111_device_driver = {
        .resume         = sa1111_resume,
 };
 
-/*
- *     Register the SA1111 driver with LDM.
- */
-static int sa1111_driver_init(void)
-{
-       driver_register(&sa1111_device_driver);
-       return 0;
-}
-
-arch_initcall(sa1111_driver_init);
-
 /*
  *     Get the parent device driver (us) structure
  *     from a child function device
@@ -1180,13 +1169,6 @@ struct bus_type sa1111_bus_type = {
        .resume         = sa1111_bus_resume,
 };
 
-static int sa1111_rab_bus_init(void)
-{
-       return bus_register(&sa1111_bus_type);
-}
-
-postcore_initcall(sa1111_rab_bus_init);
-
 int sa1111_driver_register(struct sa1111_driver *driver)
 {
        driver->drv.probe = sa1111_bus_probe;
@@ -1200,6 +1182,26 @@ void sa1111_driver_unregister(struct sa1111_driver *driver)
        driver_unregister(&driver->drv);
 }
 
+static int __init sa1111_init(void)
+{
+       int ret = bus_register(&sa1111_bus_type);
+       if (ret == 0)
+               driver_register(&sa1111_device_driver);
+       return ret;
+}
+
+static void __exit sa1111_exit(void)
+{
+       driver_unregister(&sa1111_device_driver);
+       bus_unregister(&sa1111_bus_type);
+}
+
+module_init(sa1111_init);
+module_exit(sa1111_exit);
+
+MODULE_DESCRIPTION("Intel Corporation SA1111 core driver");
+MODULE_LICENSE("GPL");
+
 EXPORT_SYMBOL(sa1111_check_dma_bug);
 EXPORT_SYMBOL(sa1111_select_audio_mode);
 EXPORT_SYMBOL(sa1111_set_audio_rate);
index 8a5de9abc430ac1cc4a3d4250b0de50ce47ca8d0..ad0731607668523b6b972fce8465323b74e75d0e 100644 (file)
@@ -543,7 +543,7 @@ struct sa1111_dev {
 #define SA1111_DEV(_d) container_of((_d), struct sa1111_dev, dev)
 
 #define sa1111_get_drvdata(d)  dev_get_drvdata(&(d)->dev)
-#define sa1111_set_drvdata(d,p)        dev_get_drvdata(&(d)->dev, p)
+#define sa1111_set_drvdata(d,p)        dev_set_drvdata(&(d)->dev, p)
 
 struct sa1111_driver {
        struct device_driver    drv;
@@ -558,11 +558,6 @@ struct sa1111_driver {
 
 #define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
 
-/*
- * Probe for a SA1111 chip.
- */
-extern int sa1111_init(unsigned long phys, unsigned int irq);
-
 /*
  * These frob the SKPCR register.
  */