Skip to content

Commit

Permalink
OHCI: Fix problem if SM501 and another platform driver is selected
Browse files Browse the repository at this point in the history
If the SM501 and another platform driver, such as the SM501
then we end up defining PLATFORM_DRIVER twice. This patch
seperated the SM501 onto a seperate define of SM501_OHCI_DRIVER
so that it can be selected without overwriting the original
definition.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ben Dooks authored and Greg Kroah-Hartman committed Jul 4, 2008
1 parent c461a97 commit 3ee38d8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,14 +1054,15 @@ MODULE_LICENSE ("GPL");

#ifdef CONFIG_MFD_SM501
#include "ohci-sm501.c"
#define PLATFORM_DRIVER ohci_hcd_sm501_driver
#define SM501_OHCI_DRIVER ohci_hcd_sm501_driver
#endif

#if !defined(PCI_DRIVER) && \
!defined(PLATFORM_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(SA1111_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(SM501_OHCI_DRIVER) && \
!defined(SSB_OHCI_DRIVER)
#error "missing bus glue for ohci-hcd"
#endif
Expand Down Expand Up @@ -1121,9 +1122,18 @@ static int __init ohci_hcd_mod_init(void)
goto error_ssb;
#endif

#ifdef SM501_OHCI_DRIVER
retval = platform_driver_register(&SM501_OHCI_DRIVER);
if (retval < 0)
goto error_sm501;
#endif

return retval;

/* Error path */
#ifdef SM501_OHCI_DRIVER
error_sm501:
#endif
#ifdef SSB_OHCI_DRIVER
error_ssb:
#endif
Expand Down Expand Up @@ -1159,6 +1169,9 @@ module_init(ohci_hcd_mod_init);

static void __exit ohci_hcd_mod_exit(void)
{
#ifdef SM501_OHCI_DRIVER
platform_driver_unregister(&SM501_OHCI_DRIVER);
#endif
#ifdef SSB_OHCI_DRIVER
ssb_driver_unregister(&SSB_OHCI_DRIVER);
#endif
Expand Down

0 comments on commit 3ee38d8

Please sign in to comment.