Browse Source

USB: OTG: msm: Fix bug in msm_otg_mode_write

The driver private data is retrieved incorrectly which results
a crash when written into "mode" debugfs file.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Pavankumar Kondeti 14 years ago
parent
commit
e2904ee43c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/usb/otg/msm72k_otg.c

+ 2 - 1
drivers/usb/otg/msm72k_otg.c

@@ -723,7 +723,8 @@ static int msm_otg_mode_open(struct inode *inode, struct file *file)
 static ssize_t msm_otg_mode_write(struct file *file, const char __user *ubuf,
 				size_t count, loff_t *ppos)
 {
-	struct msm_otg *motg = file->private_data;
+	struct seq_file *s = file->private_data;
+	struct msm_otg *motg = s->private;
 	char buf[16];
 	struct otg_transceiver *otg = &motg->otg;
 	int status = count;