Commit 18bcb4a
mtd: spi-nor: sst: Factor out common write operation to
Writing to the Flash in `sst_nor_write()` is a 3-step process:
first an optional one-byte write to get 2-byte-aligned, then the
bulk of the data is written out in vendor-specific 2-byte writes.
Finally, if there's a byte left over, another one-byte write.
This was implemented 3 times in the body of `sst_nor_write()`.
To reduce code duplication, factor out these sub-steps to their
own function.
Signed-off-by: Csókás, Bence <[email protected]>
Reviewed-by: Pratyush Yadav <[email protected]>
[[email protected]: fixup whitespace, use %zu instead of %i in WARN()]
Signed-off-by: Pratyush Yadav <[email protected]>
Link: https://lore.kernel.org/r/[email protected]sst_nor_write_data()
1 parent 8400291 commit 18bcb4a
1 file changed
+19
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
170 | 185 | | |
171 | 186 | | |
172 | 187 | | |
| |||
188 | 203 | | |
189 | 204 | | |
190 | 205 | | |
191 | | - | |
192 | | - | |
193 | 206 | | |
194 | | - | |
| 207 | + | |
195 | 208 | | |
196 | 209 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 210 | | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
208 | | - | |
209 | | - | |
210 | 217 | | |
211 | | - | |
| 218 | + | |
212 | 219 | | |
213 | 220 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 221 | + | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| |||
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
237 | | - | |
238 | | - | |
| 241 | + | |
239 | 242 | | |
240 | 243 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | 244 | | |
246 | 245 | | |
247 | 246 | | |
| |||
0 commit comments