File tree Expand file tree Collapse file tree 1 file changed +27
-13
lines changed Expand file tree Collapse file tree 1 file changed +27
-13
lines changed Original file line number Diff line number Diff line change @@ -292,23 +292,18 @@ static void mmc_mrq_pr_debug(struct mmc_host *host, struct mmc_request *mrq)
292
292
}
293
293
}
294
294
295
- static int mmc_start_request (struct mmc_host * host , struct mmc_request * mrq )
295
+ static int mmc_mrq_prep (struct mmc_host * host , struct mmc_request * mrq )
296
296
{
297
297
#ifdef CONFIG_MMC_DEBUG
298
298
unsigned int i , sz ;
299
299
struct scatterlist * sg ;
300
300
#endif
301
- mmc_retune_hold (host );
302
-
303
- if (mmc_card_removed (host -> card ))
304
- return - ENOMEDIUM ;
305
-
306
- mmc_mrq_pr_debug (host , mrq );
307
-
308
- WARN_ON (!host -> claimed );
309
301
310
- mrq -> cmd -> error = 0 ;
311
- mrq -> cmd -> mrq = mrq ;
302
+ if (mrq -> cmd ) {
303
+ mrq -> cmd -> error = 0 ;
304
+ mrq -> cmd -> mrq = mrq ;
305
+ mrq -> cmd -> data = mrq -> data ;
306
+ }
312
307
if (mrq -> sbc ) {
313
308
mrq -> sbc -> error = 0 ;
314
309
mrq -> sbc -> mrq = mrq ;
@@ -325,8 +320,6 @@ static int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
325
320
if (sz != mrq -> data -> blocks * mrq -> data -> blksz )
326
321
return - EINVAL ;
327
322
#endif
328
-
329
- mrq -> cmd -> data = mrq -> data ;
330
323
mrq -> data -> error = 0 ;
331
324
mrq -> data -> mrq = mrq ;
332
325
if (mrq -> stop ) {
@@ -335,6 +328,27 @@ static int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
335
328
mrq -> stop -> mrq = mrq ;
336
329
}
337
330
}
331
+
332
+ return 0 ;
333
+ }
334
+
335
+ static int mmc_start_request (struct mmc_host * host , struct mmc_request * mrq )
336
+ {
337
+ int err ;
338
+
339
+ mmc_retune_hold (host );
340
+
341
+ if (mmc_card_removed (host -> card ))
342
+ return - ENOMEDIUM ;
343
+
344
+ mmc_mrq_pr_debug (host , mrq );
345
+
346
+ WARN_ON (!host -> claimed );
347
+
348
+ err = mmc_mrq_prep (host , mrq );
349
+ if (err )
350
+ return err ;
351
+
338
352
led_trigger_event (host -> led , LED_FULL );
339
353
__mmc_start_request (host , mrq );
340
354
You can’t perform that action at this time.
0 commit comments