diff options
author | Richard Purdie <richard@ted.(none)> | 2009-04-28 17:13:57 +0100 |
---|---|---|
committer | Richard Purdie <richard@ted.(none)> | 2009-04-28 17:13:57 +0100 |
commit | 6a6f5cc8206f35dba044f59ae59ed878c2f8fb94 (patch) | |
tree | d325b4fe4696551589573a1b43c19e82cc0cd0d1 /meta/packages/linux/linux-omap-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch | |
parent | a8e1e028f85b4d6f37238b9cbb0bab19b5939b29 (diff) | |
parent | 0adc74b06210f1be01145a5977a36b83aca0aa68 (diff) | |
download | openembedded-core-6a6f5cc8206f35dba044f59ae59ed878c2f8fb94.tar.gz openembedded-core-6a6f5cc8206f35dba044f59ae59ed878c2f8fb94.tar.bz2 openembedded-core-6a6f5cc8206f35dba044f59ae59ed878c2f8fb94.tar.xz openembedded-core-6a6f5cc8206f35dba044f59ae59ed878c2f8fb94.zip |
Merge branch 'marcin/trunk' of git://git.pokylinux.org/poky-contrib
Diffstat (limited to 'meta/packages/linux/linux-omap-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch')
-rw-r--r-- | meta/packages/linux/linux-omap-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-omap-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch b/meta/packages/linux/linux-omap-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch new file mode 100644 index 000000000..21fe7bea1 --- /dev/null +++ b/meta/packages/linux/linux-omap-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch @@ -0,0 +1,90 @@ +From ae4f027580168814f734cf3c41a662a7f10c744c Mon Sep 17 00:00:00 2001 +From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> +Date: Tue, 31 Mar 2009 12:28:31 -0700 +Subject: [PATCH] nop-usb-xceiv: behave when linked as a module + +The NOP OTG transceiver driver needs to be usable from modules. +Make sure its symbols are always accessible at both compile and +link time, and make sure the device instance is allocated from +the heap so that device lifetime rules are obeyed. + +Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> +--- + drivers/usb/otg/nop-usb-xceiv.c | 25 ++++++++++--------------- + include/linux/usb/otg.h | 4 ++-- + 2 files changed, 12 insertions(+), 17 deletions(-) + +diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c +index 4b933f6..9ed5ea5 100644 +--- a/drivers/usb/otg/nop-usb-xceiv.c ++++ b/drivers/usb/otg/nop-usb-xceiv.c +@@ -22,8 +22,8 @@ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Current status: +- * this is to add "nop" transceiver for all those phy which is +- * autonomous such as isp1504 etc. ++ * This provides a "nop" transceiver for PHYs which are ++ * autonomous such as isp1504, isp1707, etc. + */ + + #include <linux/module.h> +@@ -36,30 +36,25 @@ struct nop_usb_xceiv { + struct device *dev; + }; + +-static u64 nop_xceiv_dmamask = DMA_32BIT_MASK; +- +-static struct platform_device nop_xceiv_device = { +- .name = "nop_usb_xceiv", +- .id = -1, +- .dev = { +- .dma_mask = &nop_xceiv_dmamask, +- .coherent_dma_mask = DMA_32BIT_MASK, +- .platform_data = NULL, +- }, +-}; ++static struct platform_device *pd; + + void usb_nop_xceiv_register(void) + { +- if (platform_device_register(&nop_xceiv_device) < 0) { ++ if (pd) ++ return; ++ pd = platform_device_register_simple("nop_usb_xceiv", -1, NULL, 0); ++ if (!pd) { + printk(KERN_ERR "Unable to register usb nop transceiver\n"); + return; + } + } ++EXPORT_SYMBOL(usb_nop_xceiv_register); + + void usb_nop_xceiv_unregister(void) + { +- platform_device_unregister(&nop_xceiv_device); ++ platform_device_unregister(pd); + } ++EXPORT_SYMBOL(usb_nop_xceiv_unregister); + + static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x) + { +diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h +index 54f2424..7df8bae 100644 +--- a/include/linux/usb/otg.h ++++ b/include/linux/usb/otg.h +@@ -80,10 +80,10 @@ struct otg_transceiver { + + /* for board-specific init logic */ + extern int otg_set_transceiver(struct otg_transceiver *); +-#ifdef CONFIG_NOP_USB_XCEIV ++ ++/* sometimes transceivers are accessed only through e.g. ULPI */ + extern void usb_nop_xceiv_register(void); + extern void usb_nop_xceiv_unregister(void); +-#endif + + + /* for usb host and peripheral controller drivers */ +-- +1.6.0.4 + |