]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci-pnx4008.c
usb host: fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci-pnx4008.c
index 3a8cbfb69054c00c40e2d2705a5cb373dcbb8294..28b458f20cc3013749503821119e5e741e58a85f 100644 (file)
@@ -112,9 +112,9 @@ static int isp1301_detach(struct i2c_client *client);
 static int isp1301_command(struct i2c_client *client, unsigned int cmd,
                           void *arg);
 
-static unsigned short normal_i2c[] =
+static const unsigned short normal_i2c[] =
     { ISP1301_I2C_ADDR, ISP1301_I2C_ADDR + 1, I2C_CLIENT_END };
-static unsigned short dummy_i2c_addrlist[] = { I2C_CLIENT_END };
+static const unsigned short dummy_i2c_addrlist[] = { I2C_CLIENT_END };
 
 static struct i2c_client_address_data addr_data = {
        .normal_i2c = normal_i2c,
@@ -123,7 +123,6 @@ static struct i2c_client_address_data addr_data = {
 };
 
 struct i2c_driver isp1301_driver = {
-       .id = I2C_DRIVERID_I2CDEV,      /* Fake Id */
        .class = I2C_CLASS_HWMON,
        .attach_adapter = isp1301_probe,
        .detach_client = isp1301_detach,
@@ -134,7 +133,7 @@ static int isp1301_attach(struct i2c_adapter *adap, int addr, int kind)
 {
        struct i2c_client *c;
 
-       c = (struct i2c_client *)kzalloc(sizeof(*c), GFP_KERNEL);
+       c = kzalloc(sizeof(*c), GFP_KERNEL);
 
        if (!c)
                return -ENOMEM;
@@ -421,7 +420,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
        ohci_hcd_init(ohci);
 
        dev_info(&pdev->dev, "at 0x%p, irq %d\n", hcd->regs, hcd->irq);
-       ret = usb_add_hcd(hcd, irq, SA_INTERRUPT);
+       ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (ret == 0)
                return ret;
 
@@ -457,23 +456,15 @@ static int usb_hcd_pnx4008_remove(struct platform_device *pdev)
        return 0;
 }
 
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:usb-ohci");
+
 static struct platform_driver usb_hcd_pnx4008_driver = {
        .driver = {
                .name = "usb-ohci",
+               .owner  = THIS_MODULE,
        },
        .probe = usb_hcd_pnx4008_probe,
        .remove = usb_hcd_pnx4008_remove,
 };
 
-static int __init usb_hcd_pnx4008_init(void)
-{
-       return platform_driver_register(&usb_hcd_pnx4008_driver);
-}
-
-static void __exit usb_hcd_pnx4008_cleanup(void)
-{
-       return platform_driver_unregister(&usb_hcd_pnx4008_driver);
-}
-
-module_init(usb_hcd_pnx4008_init);
-module_exit(usb_hcd_pnx4008_cleanup);