diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2012-02-28 06:57:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-02 19:20:28 -0500 |
commit | 2e8d3fe4bf680b8263e0c81a8aa46a8d07b0f7be (patch) | |
tree | 0837268b702753249555dc991638f83cd763cd25 | |
parent | b1116dcc63a91ee79a122abea025aab15ea2c8e7 (diff) |
usb: isp116x-hcd: Convert to module_platform_driver
Use the module_platform_driver macro, move the usb_disabled() check to
the probe function and get rid of the rather pointless message on module
load.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index d91e5f211a76..924880087a74 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -1569,6 +1569,9 @@ static int __devinit isp116x_probe(struct platform_device *pdev) | |||
1569 | int ret = 0; | 1569 | int ret = 0; |
1570 | unsigned long irqflags; | 1570 | unsigned long irqflags; |
1571 | 1571 | ||
1572 | if (usb_disabled()) | ||
1573 | return -ENODEV; | ||
1574 | |||
1572 | if (pdev->num_resources < 3) { | 1575 | if (pdev->num_resources < 3) { |
1573 | ret = -ENODEV; | 1576 | ret = -ENODEV; |
1574 | goto err1; | 1577 | goto err1; |
@@ -1708,22 +1711,4 @@ static struct platform_driver isp116x_driver = { | |||
1708 | }, | 1711 | }, |
1709 | }; | 1712 | }; |
1710 | 1713 | ||
1711 | /*-----------------------------------------------------------------*/ | 1714 | module_platform_driver(isp116x_driver); |
1712 | |||
1713 | static int __init isp116x_init(void) | ||
1714 | { | ||
1715 | if (usb_disabled()) | ||
1716 | return -ENODEV; | ||
1717 | |||
1718 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); | ||
1719 | return platform_driver_register(&isp116x_driver); | ||
1720 | } | ||
1721 | |||
1722 | module_init(isp116x_init); | ||
1723 | |||
1724 | static void __exit isp116x_cleanup(void) | ||
1725 | { | ||
1726 | platform_driver_unregister(&isp116x_driver); | ||
1727 | } | ||
1728 | |||
1729 | module_exit(isp116x_cleanup); | ||