[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1437512708.29812.12.camel@decadent.org.uk>
Date: Tue, 21 Jul 2015 22:05:08 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Nicholas Krause <xerofoify@...il.com>, ulf.hansson@...aro.org
Cc: kuninori.morimoto.gx@...esas.com, jh80.chung@...sung.com,
adrian.hunter@...el.com, chuanxiao.dong@...el.com,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc:Fix error handling in the function mmc_blk_remove
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@...il.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
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists