aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/g_ffs.c
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2010-11-12 08:29:28 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-16 16:54:46 -0500
commit5ab54cf7acf418573c9204371cf1ab3497c451ee (patch)
tree0de5d62ef608409c4737db60dd1db5b4ce1347b1 /drivers/usb/gadget/g_ffs.c
parent7189ba939ea0e74f73d7b30573b849c732835fc5 (diff)
usb: gadget: FunctionFS: fix typos and coding style
This commit changes FunctionFS as to make it more compliant with coding style as well as fixes several typos. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/g_ffs.c')
-rw-r--r--drivers/usb/gadget/g_ffs.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
index af75e3620849..3dc19892cfdc 100644
--- a/drivers/usb/gadget/g_ffs.c
+++ b/drivers/usb/gadget/g_ffs.c
@@ -1,7 +1,27 @@
1/*
2 * g_ffs.c -- user mode file system API for USB composite function controllers
3 *
4 * Copyright (C) 2010 Samsung Electronics
5 * Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
1#include <linux/module.h> 22#include <linux/module.h>
2#include <linux/utsname.h> 23#include <linux/utsname.h>
3 24
4
5/* 25/*
6 * kbuild is not very cooperative with respect to linking separately 26 * kbuild is not very cooperative with respect to linking separately
7 * compiled library objects into one module. So for now we won't use 27 * compiled library objects into one module. So for now we won't use
@@ -43,7 +63,6 @@ static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
43 63
44#include "f_fs.c" 64#include "f_fs.c"
45 65
46
47#define DRIVER_NAME "g_ffs" 66#define DRIVER_NAME "g_ffs"
48#define DRIVER_DESC "USB Function Filesystem" 67#define DRIVER_DESC "USB Function Filesystem"
49#define DRIVER_VERSION "24 Aug 2004" 68#define DRIVER_VERSION "24 Aug 2004"
@@ -73,8 +92,6 @@ MODULE_PARM_DESC(bDeviceSubClass, "USB Device subclass");
73module_param_named(bDeviceProtocol, gfs_dev_desc.bDeviceProtocol, byte, 0644); 92module_param_named(bDeviceProtocol, gfs_dev_desc.bDeviceProtocol, byte, 0644);
74MODULE_PARM_DESC(bDeviceProtocol, "USB Device protocol"); 93MODULE_PARM_DESC(bDeviceProtocol, "USB Device protocol");
75 94
76
77
78static const struct usb_descriptor_header *gfs_otg_desc[] = { 95static const struct usb_descriptor_header *gfs_otg_desc[] = {
79 (const struct usb_descriptor_header *) 96 (const struct usb_descriptor_header *)
80 &(const struct usb_otg_descriptor) { 97 &(const struct usb_otg_descriptor) {
@@ -91,8 +108,7 @@ static const struct usb_descriptor_header *gfs_otg_desc[] = {
91 NULL 108 NULL
92}; 109};
93 110
94/* string IDs are assigned dynamically */ 111/* String IDs are assigned dynamically */
95
96static struct usb_string gfs_strings[] = { 112static struct usb_string gfs_strings[] = {
97#ifdef CONFIG_USB_FUNCTIONFS_RNDIS 113#ifdef CONFIG_USB_FUNCTIONFS_RNDIS
98 { .s = "FunctionFS + RNDIS" }, 114 { .s = "FunctionFS + RNDIS" },
@@ -114,8 +130,6 @@ static struct usb_gadget_strings *gfs_dev_strings[] = {
114 NULL, 130 NULL,
115}; 131};
116 132
117
118
119struct gfs_configuration { 133struct gfs_configuration {
120 struct usb_configuration c; 134 struct usb_configuration c;
121 int (*eth)(struct usb_configuration *c, u8 *ethaddr); 135 int (*eth)(struct usb_configuration *c, u8 *ethaddr);
@@ -138,7 +152,6 @@ struct gfs_configuration {
138#endif 152#endif
139}; 153};
140 154
141
142static int gfs_bind(struct usb_composite_dev *cdev); 155static int gfs_bind(struct usb_composite_dev *cdev);
143static int gfs_unbind(struct usb_composite_dev *cdev); 156static int gfs_unbind(struct usb_composite_dev *cdev);
144static int gfs_do_config(struct usb_configuration *c); 157static int gfs_do_config(struct usb_configuration *c);
@@ -151,11 +164,9 @@ static struct usb_composite_driver gfs_driver = {
151 .iProduct = DRIVER_DESC, 164 .iProduct = DRIVER_DESC,
152}; 165};
153 166
154
155static struct ffs_data *gfs_ffs_data; 167static struct ffs_data *gfs_ffs_data;
156static unsigned long gfs_registered; 168static unsigned long gfs_registered;
157 169
158
159static int gfs_init(void) 170static int gfs_init(void)
160{ 171{
161 ENTER(); 172 ENTER();
@@ -175,7 +186,6 @@ static void gfs_exit(void)
175} 186}
176module_exit(gfs_exit); 187module_exit(gfs_exit);
177 188
178
179static int functionfs_ready_callback(struct ffs_data *ffs) 189static int functionfs_ready_callback(struct ffs_data *ffs)
180{ 190{
181 int ret; 191 int ret;
@@ -200,14 +210,11 @@ static void functionfs_closed_callback(struct ffs_data *ffs)
200 usb_composite_unregister(&gfs_driver); 210 usb_composite_unregister(&gfs_driver);
201} 211}
202 212
203
204static int functionfs_check_dev_callback(const char *dev_name) 213static int functionfs_check_dev_callback(const char *dev_name)
205{ 214{
206 return 0; 215 return 0;
207} 216}
208 217
209
210
211static int gfs_bind(struct usb_composite_dev *cdev) 218static int gfs_bind(struct usb_composite_dev *cdev)
212{ 219{
213 int ret, i; 220 int ret, i;
@@ -274,7 +281,6 @@ static int gfs_unbind(struct usb_composite_dev *cdev)
274 return 0; 281 return 0;
275} 282}
276 283
277
278static int gfs_do_config(struct usb_configuration *c) 284static int gfs_do_config(struct usb_configuration *c)
279{ 285{
280 struct gfs_configuration *gc = 286 struct gfs_configuration *gc =
@@ -315,7 +321,6 @@ static int gfs_do_config(struct usb_configuration *c)
315 return 0; 321 return 0;
316} 322}
317 323
318
319#ifdef CONFIG_USB_FUNCTIONFS_ETH 324#ifdef CONFIG_USB_FUNCTIONFS_ETH
320 325
321static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) 326static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])