public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Nicholas Krause <xerofoify@gmail.com>, ulf.hansson@linaro.org
Cc: kuninori.morimoto.gx@renesas.com, jh80.chung@samsung.com,
	adrian.hunter@intel.com, chuanxiao.dong@intel.com,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc:Fix error handling in the function mmc_blk_remove
Date: Tue, 21 Jul 2015 22:05:08 +0100	[thread overview]
Message-ID: <1437512708.29812.12.camel@decadent.org.uk> (raw)
In-Reply-To: <1437504701-24429-1-git-send-email-xerofoify@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

On Tue, 2015-07-21 at 14:51 -0400, Nicholas Krause wrote:
> This fixes error handling in the function mmc_blk_remove by
> checking the return value of the call to mmc_blk_part_switch
> and if it has failed by returning a error code we now print
> out on the console to the user that removed the mmc device
> has failed before returning immediately.
> v2
> Change pr_crit to preferred dev_crit for when printing to console
> in device functions
> Remove unneeded return statement after dev_crit statement due to
> removal functions always needing to complete successfully
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/mmc/card/block.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index c9c3d20..5b50ddf 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -2505,10 +2505,10 @@ static void mmc_blk_remove(struct mmc_card *card)
>  {
>  > 	> struct mmc_blk_data *md = dev_get_drvdata(&card->dev);
>  
> -> 	> mmc_blk_remove_parts(card, md);

No.

Ben.

>  	pm_runtime_get_sync(&card->dev);
>  > 	> mmc_claim_host(card->host);
> -> 	> mmc_blk_part_switch(card, md);
> +> 	> if (mmc_blk_part_switch(card, md))
> +> 	> 	> dev_crit(&card->dev, "Unable to successfully remove due to failed mmc_blk_part_switch call\n");
>  > 	> mmc_release_host(card->host);
>  > 	> if (card->type != MMC_TYPE_SD_COMBO)
>  > 	> 	> pm_runtime_disable(&card->dev);
-- 
Ben Hutchings
No political challenge can be met by shopping. - George Monbiot


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

       reply	other threads:[~2015-07-21 21:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1437504701-24429-1-git-send-email-xerofoify@gmail.com>
2015-07-21 21:05 ` Ben Hutchings [this message]
     [not found] <1437485391-25505-1-git-send-email-xerofoify@gmail.com>
2015-07-21 18:03 ` [PATCH] mmc:Fix error handling in the function mmc_blk_remove Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437512708.29812.12.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=adrian.hunter@intel.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=jh80.chung@samsung.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=xerofoify@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox