aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-tuna-connector.c
diff options
context:
space:
mode:
authorSang-Jun Park <sj2202.park@samsung.com>2011-10-19 17:35:51 +0900
committerDima Zavin <dima@android.com>2011-10-20 03:07:05 -0700
commitbd38abeefcd9f8e38fb3639a9fab7d42242338e3 (patch)
tree83d99a269dbe70181a03026bb7791e8fa4088f42 /arch/arm/mach-omap2/board-tuna-connector.c
parent7a19a3141eafbe0fbef2ff637ce45f12ede6343c (diff)
downloadkernel_samsung_tuna-bd38abeefcd9f8e38fb3639a9fab7d42242338e3.zip
kernel_samsung_tuna-bd38abeefcd9f8e38fb3639a9fab7d42242338e3.tar.gz
kernel_samsung_tuna-bd38abeefcd9f8e38fb3639a9fab7d42242338e3.tar.bz2
ARM: omap4: tuna: connector: fix a saving problem of switching value
When storing the swith value xxx_store function checks the length of buf. But length of buf is different between factory app and console mode. So remove the check routine of buf length. Change-Id: If41401860c2fb077d68467848be0843f6bbaddda Signed-off-by: Sang-Jun Park <sj2202.park@samsung.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-tuna-connector.c')
-rw-r--r--arch/arm/mach-omap2/board-tuna-connector.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-tuna-connector.c b/arch/arm/mach-omap2/board-tuna-connector.c
index 4068d82..46b6153 100644
--- a/arch/arm/mach-omap2/board-tuna-connector.c
+++ b/arch/arm/mach-omap2/board-tuna-connector.c
@@ -564,14 +564,13 @@ static ssize_t tuna_otg_usb_sel_store(struct device *dev,
const char *buf, size_t size)
{
struct tuna_otg *tuna_otg = dev_get_drvdata(dev);
- size_t len = strlen(buf);
int old_mode;
mutex_lock(&tuna_otg->lock);
old_mode = tuna_otg->usb_manual_mode;
- if (!strncasecmp(buf, "PDA", 3) && len == 4) {
+ if (!strncasecmp(buf, "PDA", 3)) {
tuna_otg->usb_manual_mode = TUNA_MANUAL_USB_AP;
/* If we are transitioning from CP USB to AP USB then notify the
@@ -582,7 +581,7 @@ static ssize_t tuna_otg_usb_sel_store(struct device *dev,
tuna_cp_usb_detach(tuna_otg);
tuna_ap_usb_attach(tuna_otg);
}
- } else if (!strncasecmp(buf, "MODEM", 5) && len == 6) {
+ } else if (!strncasecmp(buf, "MODEM", 5)) {
tuna_otg->usb_manual_mode = TUNA_MANUAL_USB_MODEM;
/* If we are transitioning from AP USB to CP USB then notify the
@@ -594,7 +593,7 @@ static ssize_t tuna_otg_usb_sel_store(struct device *dev,
tuna_ap_usb_detach(tuna_otg);
tuna_cp_usb_attach(tuna_otg);
}
- } else if (!strncasecmp(buf, "NONE", 5) && len == 5) {
+ } else if (!strncasecmp(buf, "NONE", 4)) {
tuna_otg->usb_manual_mode = TUNA_MANUAL_USB_NONE;
/* If we are transitioning from CP USB to AP USB then notify the
@@ -609,7 +608,7 @@ static ssize_t tuna_otg_usb_sel_store(struct device *dev,
mutex_unlock(&tuna_otg->lock);
- return len;
+ return size;
}
static ssize_t tuna_otg_uart_switch_show(struct device *dev,
@@ -641,27 +640,26 @@ static ssize_t tuna_otg_uart_switch_store(struct device *dev,
const char *buf, size_t size)
{
struct tuna_otg *tuna_otg = dev_get_drvdata(dev);
- size_t len = strlen(buf);
mutex_lock(&tuna_otg->lock);
- if (!strncasecmp(buf, "PDA", 3) && len == 4) {
+ if (!strncasecmp(buf, "PDA", 3)) {
tuna_otg->uart_manual_mode = TUNA_MANUAL_UART_AP;
if (tuna_otg->current_device == FSA9480_DETECT_JIG)
tuna_ap_uart_actions(tuna_otg);
- } else if (!strncasecmp(buf, "MODEM", 5) && len == 6) {
+ } else if (!strncasecmp(buf, "MODEM", 5)) {
tuna_otg->uart_manual_mode = TUNA_MANUAL_UART_MODEM;
if (tuna_otg->current_device == FSA9480_DETECT_JIG)
tuna_cp_uart_actions(tuna_otg);
- } else if (!strncasecmp(buf, "LTEMODEM", 8) && len == 9 &&
+ } else if (!strncasecmp(buf, "LTEMODEM", 8) &&
omap4_tuna_get_type() == TUNA_TYPE_TORO) {
tuna_otg->uart_manual_mode = TUNA_MANUAL_UART_LTE;
if (tuna_otg->current_device == FSA9480_DETECT_JIG)
tuna_lte_uart_actions(tuna_otg);
- } else if (!strncasecmp(buf, "NONE", 5) && len == 5) {
+ } else if (!strncasecmp(buf, "NONE", 4)) {
tuna_otg->uart_manual_mode = TUNA_MANUAL_UART_NONE;
if (tuna_otg->current_device == FSA9480_DETECT_JIG)
@@ -670,7 +668,7 @@ static ssize_t tuna_otg_uart_switch_store(struct device *dev,
mutex_unlock(&tuna_otg->lock);
- return len;
+ return size;
}
#define OMAP_HDMI_HPD_ADDR 0x4A100098