Commit 5289b5350ba5442cfcfbb18488b3a9d9e4f39ede
Committed by
Pantelis Antoniou
1 parent
a626c8d418
Exists in
v2017.01-smarct4x
and in
34 other branches
mmc: Do not pass external mmc_cmd structure to mmc_send_op_cond_iter()
The previous change to use 'ocr' structure field for storing send_op_cond command response also stopped using command response directly outside of mmc_send_op_cond_iter(). Now it becomes possible to use command structure in mmc_send_op_cond_iter() locally, removing a necessity to pass it as an argument from the caller. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Showing 1 changed file with 11 additions and 13 deletions Side-by-side Diff
drivers/mmc/mmc.c
... | ... | @@ -350,34 +350,32 @@ |
350 | 350 | return 0; |
351 | 351 | } |
352 | 352 | |
353 | -/* We pass in the cmd since otherwise the init seems to fail */ | |
354 | -static int mmc_send_op_cond_iter(struct mmc *mmc, struct mmc_cmd *cmd, | |
355 | - int use_arg) | |
353 | +static int mmc_send_op_cond_iter(struct mmc *mmc, int use_arg) | |
356 | 354 | { |
355 | + struct mmc_cmd cmd; | |
357 | 356 | int err; |
358 | 357 | |
359 | - cmd->cmdidx = MMC_CMD_SEND_OP_COND; | |
360 | - cmd->resp_type = MMC_RSP_R3; | |
361 | - cmd->cmdarg = 0; | |
358 | + cmd.cmdidx = MMC_CMD_SEND_OP_COND; | |
359 | + cmd.resp_type = MMC_RSP_R3; | |
360 | + cmd.cmdarg = 0; | |
362 | 361 | if (use_arg && !mmc_host_is_spi(mmc)) { |
363 | - cmd->cmdarg = | |
362 | + cmd.cmdarg = | |
364 | 363 | (mmc->cfg->voltages & |
365 | 364 | (mmc->ocr & OCR_VOLTAGE_MASK)) | |
366 | 365 | (mmc->ocr & OCR_ACCESS_MODE); |
367 | 366 | |
368 | 367 | if (mmc->cfg->host_caps & MMC_MODE_HC) |
369 | - cmd->cmdarg |= OCR_HCS; | |
368 | + cmd.cmdarg |= OCR_HCS; | |
370 | 369 | } |
371 | - err = mmc_send_cmd(mmc, cmd, NULL); | |
370 | + err = mmc_send_cmd(mmc, &cmd, NULL); | |
372 | 371 | if (err) |
373 | 372 | return err; |
374 | - mmc->ocr = cmd->response[0]; | |
373 | + mmc->ocr = cmd.response[0]; | |
375 | 374 | return 0; |
376 | 375 | } |
377 | 376 | |
378 | 377 | static int mmc_send_op_cond(struct mmc *mmc) |
379 | 378 | { |
380 | - struct mmc_cmd cmd; | |
381 | 379 | int err, i; |
382 | 380 | |
383 | 381 | /* Some cards seem to need this */ |
... | ... | @@ -386,7 +384,7 @@ |
386 | 384 | /* Asking to the card its capabilities */ |
387 | 385 | mmc->op_cond_pending = 1; |
388 | 386 | for (i = 0; i < 2; i++) { |
389 | - err = mmc_send_op_cond_iter(mmc, &cmd, i != 0); | |
387 | + err = mmc_send_op_cond_iter(mmc, i != 0); | |
390 | 388 | if (err) |
391 | 389 | return err; |
392 | 390 | |
... | ... | @@ -407,7 +405,7 @@ |
407 | 405 | mmc->op_cond_pending = 0; |
408 | 406 | start = get_timer(0); |
409 | 407 | do { |
410 | - err = mmc_send_op_cond_iter(mmc, &cmd, 1); | |
408 | + err = mmc_send_op_cond_iter(mmc, 1); | |
411 | 409 | if (err) |
412 | 410 | return err; |
413 | 411 | if (get_timer(start) > timeout) |