* [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c
@ 2008-12-10 3:01 Helight.Xu
2008-12-10 5:25 ` Jianjun Kong
0 siblings, 1 reply; 2+ messages in thread
From: Helight.Xu @ 2008-12-10 3:01 UTC (permalink / raw)
To: David Brownell; +Cc: linux-kernel, akpm, torvalds
[-- 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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c
2008-12-10 3:01 [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c Helight.Xu
@ 2008-12-10 5:25 ` Jianjun Kong
0 siblings, 0 replies; 2+ messages in thread
From: Jianjun Kong @ 2008-12-10 5:25 UTC (permalink / raw)
To: Helight.Xu; +Cc: David Brownell, linux-kernel, akpm, torvalds
On Wed, Dec 10, 2008 at 11:01:51AM +0800, Helight.Xu wrote:
>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.
The original code can return the correct value.
It contains 0 and -EINVAL, not only 0. So this change is not essential.
--
Jianjun Kong |Happy Hacking
Homepage: http://kongove.cn
Gtalk:KongJianjun@gmail.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-10 5:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 3:01 [PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c Helight.Xu
2008-12-10 5:25 ` Jianjun Kong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox