[PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions

Ted Juan ted.juan at gmail.com
Fri Jun 20 02:11:56 PDT 2014


From: Ted Juan <ted.juan at weintek.com>

 These two function's switch case lack the 'break' that make them always return error.


Signed-off-by: Ted Juan <ted.juan at weintek.com>
---
 drivers/mtd/devices/elm.c  |    2 ++
 "toreqq\033\033qq\033\033" |   20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 "toreqq\033\033qq\033\033"

diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index 7df8694..b4f61c7 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info)
 					ELM_SYNDROME_FRAGMENT_1 + offset);
 			regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_0 + offset);
+			break;
 		default:
 			return -EINVAL;
 		}
@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info)
 					regs->elm_syndrome_fragment_1[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,
 					regs->elm_syndrome_fragment_0[i]);
+			break;
 		default:
 			return -EINVAL;
 		}
diff --git "a/toreqq\033\033qq\033\033" "b/toreqq\033\033qq\033\033"
new file mode 100644
index 0000000..4a7b35c
--- /dev/null
+++ "b/toreqq\033\033qq\033\033"
@@ -0,0 +1,20 @@
+diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
+index 7df8694..8e6ba6c 100644
+--- a/drivers/mtd/devices/elm.c
++++ b/drivers/mtd/devices/elm.c
+@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info)
+ 					ELM_SYNDROME_FRAGMENT_1 + offset);
+ 			regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,
+ 					ELM_SYNDROME_FRAGMENT_0 + offset);
++                        break;
+ 		default:
+ 			return -EINVAL;
+ 		}
+@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info)
+ 					regs->elm_syndrome_fragment_1[i]);
+ 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,
+ 					regs->elm_syndrome_fragment_0[i]);
++                        break;
+ 		default:
+ 			return -EINVAL;
+ 		}
-- 
1.7.9.5




More information about the linux-mtd mailing list