lkml.org 
[lkml]   [2008]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
Subject[PATCH] rewrite the return method of static int s3c24xx_spi_setup(struct spi_device *spi) in drivers/spi/spi_s3c24xx.c
From
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.cnFrom 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
\
 
 \ /
  Last update: 2008-12-10 04:05    [W:0.033 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site