Commit 5ab54cf7 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Greg Kroah-Hartman

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: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7189ba93
This diff is collapsed.
/*
* g_ffs.c -- user mode file system API for USB composite function controllers
*
* Copyright (C) 2010 Samsung Electronics
* Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/module.h> #include <linux/module.h>
#include <linux/utsname.h> #include <linux/utsname.h>
/* /*
* kbuild is not very cooperative with respect to linking separately * kbuild is not very cooperative with respect to linking separately
* compiled library objects into one module. So for now we won't use * 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,7 +63,6 @@ static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
#include "f_fs.c" #include "f_fs.c"
#define DRIVER_NAME "g_ffs" #define DRIVER_NAME "g_ffs"
#define DRIVER_DESC "USB Function Filesystem" #define DRIVER_DESC "USB Function Filesystem"
#define DRIVER_VERSION "24 Aug 2004" #define DRIVER_VERSION "24 Aug 2004"
...@@ -73,8 +92,6 @@ MODULE_PARM_DESC(bDeviceSubClass, "USB Device subclass"); ...@@ -73,8 +92,6 @@ MODULE_PARM_DESC(bDeviceSubClass, "USB Device subclass");
module_param_named(bDeviceProtocol, gfs_dev_desc.bDeviceProtocol, byte, 0644); module_param_named(bDeviceProtocol, gfs_dev_desc.bDeviceProtocol, byte, 0644);
MODULE_PARM_DESC(bDeviceProtocol, "USB Device protocol"); MODULE_PARM_DESC(bDeviceProtocol, "USB Device protocol");
static const struct usb_descriptor_header *gfs_otg_desc[] = { static const struct usb_descriptor_header *gfs_otg_desc[] = {
(const struct usb_descriptor_header *) (const struct usb_descriptor_header *)
&(const struct usb_otg_descriptor) { &(const struct usb_otg_descriptor) {
...@@ -91,8 +108,7 @@ static const struct usb_descriptor_header *gfs_otg_desc[] = { ...@@ -91,8 +108,7 @@ static const struct usb_descriptor_header *gfs_otg_desc[] = {
NULL NULL
}; };
/* string IDs are assigned dynamically */ /* String IDs are assigned dynamically */
static struct usb_string gfs_strings[] = { static struct usb_string gfs_strings[] = {
#ifdef CONFIG_USB_FUNCTIONFS_RNDIS #ifdef CONFIG_USB_FUNCTIONFS_RNDIS
{ .s = "FunctionFS + RNDIS" }, { .s = "FunctionFS + RNDIS" },
...@@ -114,8 +130,6 @@ static struct usb_gadget_strings *gfs_dev_strings[] = { ...@@ -114,8 +130,6 @@ static struct usb_gadget_strings *gfs_dev_strings[] = {
NULL, NULL,
}; };
struct gfs_configuration { struct gfs_configuration {
struct usb_configuration c; struct usb_configuration c;
int (*eth)(struct usb_configuration *c, u8 *ethaddr); int (*eth)(struct usb_configuration *c, u8 *ethaddr);
...@@ -138,7 +152,6 @@ struct gfs_configuration { ...@@ -138,7 +152,6 @@ struct gfs_configuration {
#endif #endif
}; };
static int gfs_bind(struct usb_composite_dev *cdev); static int gfs_bind(struct usb_composite_dev *cdev);
static int gfs_unbind(struct usb_composite_dev *cdev); static int gfs_unbind(struct usb_composite_dev *cdev);
static int gfs_do_config(struct usb_configuration *c); static int gfs_do_config(struct usb_configuration *c);
...@@ -151,11 +164,9 @@ static struct usb_composite_driver gfs_driver = { ...@@ -151,11 +164,9 @@ static struct usb_composite_driver gfs_driver = {
.iProduct = DRIVER_DESC, .iProduct = DRIVER_DESC,
}; };
static struct ffs_data *gfs_ffs_data; static struct ffs_data *gfs_ffs_data;
static unsigned long gfs_registered; static unsigned long gfs_registered;
static int gfs_init(void) static int gfs_init(void)
{ {
ENTER(); ENTER();
...@@ -175,7 +186,6 @@ static void gfs_exit(void) ...@@ -175,7 +186,6 @@ static void gfs_exit(void)
} }
module_exit(gfs_exit); module_exit(gfs_exit);
static int functionfs_ready_callback(struct ffs_data *ffs) static int functionfs_ready_callback(struct ffs_data *ffs)
{ {
int ret; int ret;
...@@ -200,14 +210,11 @@ static void functionfs_closed_callback(struct ffs_data *ffs) ...@@ -200,14 +210,11 @@ static void functionfs_closed_callback(struct ffs_data *ffs)
usb_composite_unregister(&gfs_driver); usb_composite_unregister(&gfs_driver);
} }
static int functionfs_check_dev_callback(const char *dev_name) static int functionfs_check_dev_callback(const char *dev_name)
{ {
return 0; return 0;
} }
static int gfs_bind(struct usb_composite_dev *cdev) static int gfs_bind(struct usb_composite_dev *cdev)
{ {
int ret, i; int ret, i;
...@@ -274,7 +281,6 @@ static int gfs_unbind(struct usb_composite_dev *cdev) ...@@ -274,7 +281,6 @@ static int gfs_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static int gfs_do_config(struct usb_configuration *c) static int gfs_do_config(struct usb_configuration *c)
{ {
struct gfs_configuration *gc = struct gfs_configuration *gc =
...@@ -315,7 +321,6 @@ static int gfs_do_config(struct usb_configuration *c) ...@@ -315,7 +321,6 @@ static int gfs_do_config(struct usb_configuration *c)
return 0; return 0;
} }
#ifdef CONFIG_USB_FUNCTIONFS_ETH #ifdef CONFIG_USB_FUNCTIONFS_ETH
static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment