All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Helight.Xu" <zhwenxu@gmail.com>
To: David Brownell <dbrownell@users.sourceforge.net>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	torvalds@linux-foundation.org
Subject: [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c
Date: Wed, 10 Dec 2008 11:01:51 +0800	[thread overview]
Message-ID: <20081210030151.GA6404@helight> (raw)

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

rewrite the return method of static int 
s3c24xx_spi_setup(struct spi_device *spi) 
in drivers/spi/spi_s3c24xx.c 

reason:
s3c24xx_spi_setupxfer(spi, NULL) return 0 or -EINVAL, 
so here shoud return the ret,but only 0.

here:
 drivers/spi/spi_s3c24xx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 3eb414b..0489254 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -165,14 +165,14 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
        ret = s3c24xx_spi_setupxfer(spi, NULL);
        if (ret < 0) {
                dev_err(&spi->dev, "setupxfer returned %d\n", ret);
-               return ret;
+               goto err;
        }
 
        dev_dbg(&spi->dev, "%s: mode %d, %u bpw, %d hz\n",
                __func__, spi->mode, spi->bits_per_word,
                spi->max_speed_hz);
-                                                                                        
-       return 0;
+err:
+       return ret;
 }
 
 static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)

-- 
---------------------------------
Zhenwen Xu - Open and Free
Home Page:	http://zhwen.org
My Studio:	http://dim4.cn

[-- Attachment #2: 0001-rewrite-the-return-method-of-static-int-s3c24xx_spi_setup.patch --]
[-- Type: text/x-diff, Size: 1052 bytes --]

>From a99ab2a4a87f330125ed6263c16b4036d4991b89 Mon Sep 17 00:00:00 2001
From: Zhwen Xu <Helight.Xu@gmail.com>
Date: Wed, 10 Dec 2008 10:38:36 +0800
Subject: [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c


Signed-off-by: ZhenwenXu <helight.xu@gmail.com> 
---
 drivers/spi/spi_s3c24xx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 3eb414b..0489254 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -165,14 +165,14 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
 	ret = s3c24xx_spi_setupxfer(spi, NULL);
 	if (ret < 0) {
 		dev_err(&spi->dev, "setupxfer returned %d\n", ret);
-		return ret;
+		goto err;
 	}
 
 	dev_dbg(&spi->dev, "%s: mode %d, %u bpw, %d hz\n",
 		__func__, spi->mode, spi->bits_per_word,
 		spi->max_speed_hz);
-
-	return 0;
+err:
+	return ret;
 }
 
 static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)
-- 
1.5.6.5


             reply	other threads:[~2008-12-10  3:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-10  3:01 Helight.Xu [this message]
2008-12-10  5:25 ` [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c Jianjun Kong

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=20081210030151.GA6404@helight \
    --to=zhwenxu@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=helight.xu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.