Skip to content

Commit

Permalink
usb: otg: move usb_otg_state_string to usb-common.c
Browse files Browse the repository at this point in the history
otg.c only had a single function definition
which might make more sense to be placed in
usb-common.c. While doing that, we also delete
otg.c since it's now empty.

Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Mar 18, 2013
1 parent 42c0bf1 commit 7009bdd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 57 deletions.
3 changes: 0 additions & 3 deletions drivers/usb/otg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
ccflags-$(CONFIG_USB_GADGET_DEBUG) += -DDEBUG

# infrastructure
obj-$(CONFIG_USB_OTG_UTILS) += otg.o

# transceiver drivers
obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o
obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
Expand Down
47 changes: 0 additions & 47 deletions drivers/usb/otg/otg.c

This file was deleted.

26 changes: 26 additions & 0 deletions drivers/usb/usb-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/usb/ch9.h>
#include <linux/usb/otg.h>

const char *usb_otg_state_string(enum usb_otg_state state)
{
static const char *const names[] = {
[OTG_STATE_A_IDLE] = "a_idle",
[OTG_STATE_A_WAIT_VRISE] = "a_wait_vrise",
[OTG_STATE_A_WAIT_BCON] = "a_wait_bcon",
[OTG_STATE_A_HOST] = "a_host",
[OTG_STATE_A_SUSPEND] = "a_suspend",
[OTG_STATE_A_PERIPHERAL] = "a_peripheral",
[OTG_STATE_A_WAIT_VFALL] = "a_wait_vfall",
[OTG_STATE_A_VBUS_ERR] = "a_vbus_err",
[OTG_STATE_B_IDLE] = "b_idle",
[OTG_STATE_B_SRP_INIT] = "b_srp_init",
[OTG_STATE_B_PERIPHERAL] = "b_peripheral",
[OTG_STATE_B_WAIT_ACON] = "b_wait_acon",
[OTG_STATE_B_HOST] = "b_host",
};

if (state < 0 || state >= ARRAY_SIZE(names))
return "UNDEFINED";

return names[state];
}
EXPORT_SYMBOL_GPL(usb_otg_state_string);

const char *usb_speed_string(enum usb_device_speed speed)
{
Expand Down
7 changes: 0 additions & 7 deletions include/linux/usb/otg.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,7 @@ struct usb_otg {

};

#ifdef CONFIG_USB_OTG_UTILS
extern const char *usb_otg_state_string(enum usb_otg_state state);
#else
static inline const char *usb_otg_state_string(enum usb_otg_state state)
{
return NULL;
}
#endif

/* Context: can sleep */
static inline int
Expand Down

0 comments on commit 7009bdd

Please sign in to comment.