diff options
author | Michal Nazarewicz <m.nazarewicz@samsung.com> | 2009-11-30 04:55:40 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 14:55:27 -0500 |
commit | 396cda90d228d0851f3d64c7c85a1ecf6b8ae1e8 (patch) | |
tree | 9fc9df689e3d9e38b51d2a50d7bf0feb2978e1d8 /drivers/usb | |
parent | 3f0479e00a3fca9590ae8d9edc4e9c47b7fa0610 (diff) |
USB: Added USB_ETH_RNDIS to use instead of CONFIG_USB_ETH_RNDIS
If g_ether and g_multi are both built CONFIG_USB_ETH_RNDIS symbol
may be redefined in the later and, whats even worse, g_ether's settings
may affect g_multi's. This adds a USB_ETH_RNDIS symbol defined at the
beginning of ether.c and multi.c according toproper KConfig settings.
Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/ether.c | 16 | ||||
-rw-r--r-- | drivers/usb/gadget/multi.c | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/u_ether.h | 2 |
3 files changed, 21 insertions, 10 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 167cb2a8ecef..141372b6e7a1 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
@@ -25,6 +25,14 @@ | |||
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/utsname.h> | 26 | #include <linux/utsname.h> |
27 | 27 | ||
28 | |||
29 | #if defined USB_ETH_RNDIS | ||
30 | # undef USB_ETH_RNDIS | ||
31 | #endif | ||
32 | #ifdef CONFIG_USB_ETH_RNDIS | ||
33 | # define USB_ETH_RNDIS y | ||
34 | #endif | ||
35 | |||
28 | #include "u_ether.h" | 36 | #include "u_ether.h" |
29 | 37 | ||
30 | 38 | ||
@@ -66,7 +74,7 @@ | |||
66 | #define DRIVER_DESC "Ethernet Gadget" | 74 | #define DRIVER_DESC "Ethernet Gadget" |
67 | #define DRIVER_VERSION "Memorial Day 2008" | 75 | #define DRIVER_VERSION "Memorial Day 2008" |
68 | 76 | ||
69 | #ifdef CONFIG_USB_ETH_RNDIS | 77 | #ifdef USB_ETH_RNDIS |
70 | #define PREFIX "RNDIS/" | 78 | #define PREFIX "RNDIS/" |
71 | #else | 79 | #else |
72 | #define PREFIX "" | 80 | #define PREFIX "" |
@@ -87,7 +95,7 @@ | |||
87 | 95 | ||
88 | static inline bool has_rndis(void) | 96 | static inline bool has_rndis(void) |
89 | { | 97 | { |
90 | #ifdef CONFIG_USB_ETH_RNDIS | 98 | #ifdef USB_ETH_RNDIS |
91 | return true; | 99 | return true; |
92 | #else | 100 | #else |
93 | return false; | 101 | return false; |
@@ -110,7 +118,7 @@ static inline bool has_rndis(void) | |||
110 | 118 | ||
111 | #include "f_ecm.c" | 119 | #include "f_ecm.c" |
112 | #include "f_subset.c" | 120 | #include "f_subset.c" |
113 | #ifdef CONFIG_USB_ETH_RNDIS | 121 | #ifdef USB_ETH_RNDIS |
114 | #include "f_rndis.c" | 122 | #include "f_rndis.c" |
115 | #include "rndis.c" | 123 | #include "rndis.c" |
116 | #endif | 124 | #endif |
@@ -251,7 +259,7 @@ static struct usb_configuration rndis_config_driver = { | |||
251 | 259 | ||
252 | /*-------------------------------------------------------------------------*/ | 260 | /*-------------------------------------------------------------------------*/ |
253 | 261 | ||
254 | #ifdef CONFIG_USB_ETH_EEM | 262 | #ifdef USB_ETH_EEM |
255 | static int use_eem = 1; | 263 | static int use_eem = 1; |
256 | #else | 264 | #else |
257 | static int use_eem; | 265 | static int use_eem; |
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 64711feca845..429560100b10 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c | |||
@@ -26,8 +26,11 @@ | |||
26 | #include <linux/utsname.h> | 26 | #include <linux/utsname.h> |
27 | 27 | ||
28 | 28 | ||
29 | #if defined CONFIG_USB_G_MULTI_RNDIS | 29 | #if defined USB_ETH_RNDIS |
30 | # define CONFIG_USB_ETH_RNDIS y | 30 | # undef USB_ETH_RNDIS |
31 | #endif | ||
32 | #ifdef CONFIG_USB_ETH_RNDIS | ||
33 | # define USB_ETH_RNDIS y | ||
31 | #endif | 34 | #endif |
32 | 35 | ||
33 | 36 | ||
@@ -59,7 +62,7 @@ | |||
59 | 62 | ||
60 | #include "f_ecm.c" | 63 | #include "f_ecm.c" |
61 | #include "f_subset.c" | 64 | #include "f_subset.c" |
62 | #ifdef CONFIG_USB_ETH_RNDIS | 65 | #ifdef USB_ETH_RNDIS |
63 | # include "f_rndis.c" | 66 | # include "f_rndis.c" |
64 | # include "rndis.c" | 67 | # include "rndis.c" |
65 | #endif | 68 | #endif |
@@ -150,7 +153,7 @@ FSG_MODULE_PARAMETERS(/* no prefix */, mod_data); | |||
150 | static struct fsg_common *fsg_common; | 153 | static struct fsg_common *fsg_common; |
151 | 154 | ||
152 | 155 | ||
153 | #ifdef CONFIG_USB_ETH_RNDIS | 156 | #ifdef USB_ETH_RNDIS |
154 | 157 | ||
155 | static int __init rndis_do_config(struct usb_configuration *c) | 158 | static int __init rndis_do_config(struct usb_configuration *c) |
156 | { | 159 | { |
@@ -292,7 +295,7 @@ static int __init multi_bind(struct usb_composite_dev *cdev) | |||
292 | strings_dev[STRING_PRODUCT_IDX].id = status; | 295 | strings_dev[STRING_PRODUCT_IDX].id = status; |
293 | device_desc.iProduct = status; | 296 | device_desc.iProduct = status; |
294 | 297 | ||
295 | #ifdef CONFIG_USB_ETH_RNDIS | 298 | #ifdef USB_ETH_RNDIS |
296 | /* register our first configuration */ | 299 | /* register our first configuration */ |
297 | status = usb_add_config(cdev, &rndis_config_driver); | 300 | status = usb_add_config(cdev, &rndis_config_driver); |
298 | if (status < 0) | 301 | if (status < 0) |
diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h index 91b39ffdf6ea..fd55f450bc0e 100644 --- a/drivers/usb/gadget/u_ether.h +++ b/drivers/usb/gadget/u_ether.h | |||
@@ -112,7 +112,7 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | |||
112 | int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | 112 | int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); |
113 | int eem_bind_config(struct usb_configuration *c); | 113 | int eem_bind_config(struct usb_configuration *c); |
114 | 114 | ||
115 | #ifdef CONFIG_USB_ETH_RNDIS | 115 | #ifdef USB_ETH_RNDIS |
116 | 116 | ||
117 | int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | 117 | int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); |
118 | 118 | ||