linux-mips
[Top] [All Lists]

Re: [PATCH 8/9] au1xmmc: abort requests early if no card is present

To: Manuel Lauss <mano@roarinelk.homelinux.net>
Subject: Re: [PATCH 8/9] au1xmmc: abort requests early if no card is present
From: Pierre Ossman <drzeus@drzeus.cx>
Date: Thu, 5 Jun 2008 23:05:52 +0200
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, sshtylyov@ru.mvista.com
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAADNQTFRFEgwFRSofeTwxZEI1h1lFl1ZHeGBetHZk24VzuZJ43p2GsbKw/Lmg2MTL/NO3/+/Q//fpWFujUwAAAk5JREFUSMeNlVcWnDAMRd0bLux/tVGxiAEzic7hZ+Zd1IU6NtbYdn8daic/cgj52CPqLQ8hOBdjzsD8G2hHsCiPBS2/nTyABi93zvsYUyql1v6KSz30AeUAJLAK1uuDUI94WA7GDsAePtRDfwFRgP7DA8vvwOgQ1R5oYQUKAwOsfwDHDcAcWH+e5xagiooey1SwSAy0L8C7BaDKdgKWoNQtIjYEfHQGzMcKwNgCpLdgBn14ZzXNSPkJWK201vjiHMkXZg7AuQWCA7G2DPTiMSIsLSZxbgEIwlqEjE+9WBu0yaWOHwDLLQE9WmMieCBgtG1IAFgBzo7tlojGtbI3wFljuU4JdL3ghPeO+tFr2QHG0DOBSuN0kofaU302zmKbcTrgAWDUywG0OvXELi6gZScAdq6WnhYgvYDGu0YQjYSZs3ROID0B4y+jjpWyAhjePWkAjKwD5o09xioNBoro/+YQZjzTg8ce1CJtwFvwAMDFBEjv6cgI0P/u0DqtGJOjNSAm4e0jABxsgDYXSADQw2wwsFyzdePCAviE48QexseKNiGcp4jgKNEVAGC7QEwY5+S6Qpf50NzujHrdYgEKH0o8ZJ/AQR8HAGiaugDjG2i4ddZx4wToPwB0gQsEfjyFRKf1M+kLQC8u5iuoX8BhxYCQJPZXQ7LQdDnQR87/BdCpQQSJpREh7EMSQOvpYwJaqbAHgrUXkWehxhmUUjpsQ+IDSHlzEvidywrtDYSpnHVioNbstBLi9o3Dn/WqZ3Nw1pUQy8bN3/QdiPiVUZfpP4cDVEKd2cXEAAAAAElFTkSuQmCC
In-reply-to: <20080519080804.GI21985@roarinelk.homelinux.net>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20080519080339.GA21985@roarinelk.homelinux.net> <20080519080804.GI21985@roarinelk.homelinux.net>
Sender: linux-mips-bounce@linux-mips.org
On Mon, 19 May 2008 10:08:04 +0200
Manuel Lauss <mano@roarinelk.homelinux.net> wrote:

> From ec41439903048bf98e301dbd03426c63156ebc0e Mon Sep 17 00:00:00 2001
> From: Manuel Lauss <mlau@msc-ge.com>
> Date: Sun, 18 May 2008 15:52:43 +0200
> Subject: [PATCH] au1xmmc: abort requests early if no card is present
> 
> Don't process a request if no card is present.
> 
> Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
> ---
>  drivers/mmc/host/au1xmmc.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> index be09a14..0b30582 100644
> --- a/drivers/mmc/host/au1xmmc.c
> +++ b/drivers/mmc/host/au1xmmc.c
> @@ -689,6 +689,13 @@ static void au1xmmc_request(struct mmc_host *mmc, struct 
> mmc_request *mrq)
>       host->mrq = mrq;
>       host->status = HOST_S_CMD;
>  
> +     /* fail request immediately if no card is present */
> +     if (0 == au1xmmc_card_inserted(host)) {
> +             mrq->cmd->error = -ETIMEDOUT;
> +             au1xmmc_finish_request(host);
> +             return;
> +     }
> +
>       if (mrq->data) {
>               FLUSH_FIFO(host);
>               ret = au1xmmc_prepare_data(host, mrq->data);

You should use -ENOMEDIUM for this case.

Rgds
Pierre

Attachment: signature.asc
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>