linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] don't treat NULL from clk_get() as an error
@ 2011-01-11 12:43 Jamie Iles
  2011-01-11 12:43 ` [PATCH 01/16] crypto: omap-aes: don't treat NULL clk " Jamie Iles
                   ` (15 more replies)
  0 siblings, 16 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles

As described in a discussion with Russell King[1], clk_get() should
return a pointer to the struct clk or an ERR_PTR() encoded pointer on
error.  The pointer is effectively a cookie for the clk and NULL is a
valid cookie.  Fixup existing drivers to use IS_ERR() and not checking
against NULL or using IS_ERR_OR_NULL().

1. http://www.spinics.net/linux/lists/arm-kernel/msg110009.html

Jamie Iles (16):
  crypto: omap-aes: don't treat NULL clk as an error
  crypto: omap-sham: don't treat NULL clk as an error
  input: tnetv107x-keypad: don't treat NULL clk as an error
  input: tnetv107x-touchscreen: don't treat NULL clk as an error
  s3c2410fb: don't treat NULL clk as an error
  nuc900fb: don't treat NULL clk as an error
  staging: tidspbridge: don't treat NULL clk as an error
  ARM: samsung: serial: don't treat NULL clk as an error
  ARM: pxa: don't treat NULL clk as an error
  drivers/net: stmmac: don't treat NULL clk as an error
  drivers/net: sh_irda: don't treat NULL clk as an error
  mtd: mpc5121_nfc: don't treat NULL clk as an error
  MMC: jz4740: don't treat NULL clk as an error
  can: mpc5xxx_can: don't treat NULL clk as an error
  spi: dw_spi: don't treat NULL clk as an error
  w1: mxc_w1: don't treat NULL clk as an error

 drivers/crypto/omap-aes.c                 |    5 +++--
 drivers/crypto/omap-sham.c                |    4 ++--
 drivers/input/keyboard/tnetv107x-keypad.c |    5 +++--
 drivers/input/touchscreen/tnetv107x-ts.c  |    5 +++--
 drivers/mmc/host/jz4740_mmc.c             |    5 +++--
 drivers/mtd/nand/mpc5121_nfc.c            |    5 +++--
 drivers/net/can/mscan/mpc5xxx_can.c       |    5 +++--
 drivers/net/irda/sh_sir.c                 |    5 +++--
 drivers/net/stmmac/stmmac_timer.c         |    3 ++-
 drivers/pcmcia/pxa2xx_base.c              |    5 +++--
 drivers/serial/samsung.c                  |    3 ++-
 drivers/spi/dw_spi_mmio.c                 |    5 +++--
 drivers/staging/tidspbridge/core/wdt.c    |    9 +++++----
 drivers/video/nuc900fb.c                  |    5 +++--
 drivers/video/s3c2410fb.c                 |    5 +++--
 drivers/w1/masters/mxc_w1.c               |    5 +++--
 16 files changed, 47 insertions(+), 32 deletions(-)

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 01/16] crypto: omap-aes: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:56   ` Aaro Koskinen
  2011-01-12 19:38   ` Tobias Karnat
  2011-01-11 12:43 ` [PATCH 02/16] crypto: omap-sham: " Jamie Iles
                   ` (14 subsequent siblings)
  15 siblings, 2 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Dmitry Kasatkin, linux-crypto

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/crypto/omap-aes.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 799ca51..24d0f3f 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -17,6 +17,7 @@
 #include <linux/err.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/clk.h>
@@ -830,9 +831,9 @@ static int omap_aes_probe(struct platform_device *pdev)
 
 	/* Initializing the clock */
 	dd->iclk = clk_get(dev, "ick");
-	if (!dd->iclk) {
+	if (IS_ERR(dd->iclk)) {
 		dev_err(dev, "clock intialization failed.\n");
-		err = -ENODEV;
+		err = PTR_ERR(dd->iclk);
 		goto err_res;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 02/16] crypto: omap-sham: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
  2011-01-11 12:43 ` [PATCH 01/16] crypto: omap-aes: don't treat NULL clk " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:56   ` Aaro Koskinen
  2011-01-11 12:43 ` [PATCH 03/16] input: tnetv107x-keypad: " Jamie Iles
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Dmitry Kasatkin, linux-crypto

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/crypto/omap-sham.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index a081c7c..1acfcd2 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1150,9 +1150,9 @@ static int __devinit omap_sham_probe(struct platform_device *pdev)
 
 	/* Initializing the clock */
 	dd->iclk = clk_get(dev, "ick");
-	if (!dd->iclk) {
+	if (IS_ERR(dd->iclk)) {
 		dev_err(dev, "clock intialization failed.\n");
-		err = -ENODEV;
+		err = PTR_ERR(dd->iclk);
 		goto clk_err;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 03/16] input: tnetv107x-keypad: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
  2011-01-11 12:43 ` [PATCH 01/16] crypto: omap-aes: don't treat NULL clk " Jamie Iles
  2011-01-11 12:43 ` [PATCH 02/16] crypto: omap-sham: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 12:43 ` [PATCH 04/16] input: tnetv107x-touchscreen: " Jamie Iles
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Cyril Chemparathy, linux-input

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Cyril Chemparathy <cyril@ti.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/input/keyboard/tnetv107x-keypad.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c
index b4a81eb..c8f097a 100644
--- a/drivers/input/keyboard/tnetv107x-keypad.c
+++ b/drivers/input/keyboard/tnetv107x-keypad.c
@@ -14,6 +14,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
@@ -219,9 +220,9 @@ static int __devinit keypad_probe(struct platform_device *pdev)
 	}
 
 	kp->clk = clk_get(dev, NULL);
-	if (!kp->clk) {
+	if (IS_ERR(kp->clk)) {
 		dev_err(dev, "cannot claim device clock\n");
-		error = -EINVAL;
+		error = PTR_ERR(kp->clk);
 		goto error_clk;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 04/16] input: tnetv107x-touchscreen: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (2 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 03/16] input: tnetv107x-keypad: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-12  5:56   ` Dmitry Torokhov
  2011-01-11 12:43 ` [PATCH 05/16] s3c2410fb: " Jamie Iles
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Cyril Chemparathy, linux-input

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Cyril Chemparathy <cyril@ti.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/input/touchscreen/tnetv107x-ts.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c
index cf1dba2..22a3411 100644
--- a/drivers/input/touchscreen/tnetv107x-ts.c
+++ b/drivers/input/touchscreen/tnetv107x-ts.c
@@ -14,6 +14,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
@@ -289,9 +290,9 @@ static int __devinit tsc_probe(struct platform_device *pdev)
 	}
 
 	ts->clk = clk_get(dev, NULL);
-	if (!ts->clk) {
+	if (IS_ERR(ts->clk)) {
 		dev_err(dev, "cannot claim device clock\n");
-		error = -EINVAL;
+		error = PTR_ERR(ts->clk);
 		goto error_clk;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 05/16] s3c2410fb: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (3 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 04/16] input: tnetv107x-touchscreen: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-12  6:00   ` Paul Mundt
  2011-01-11 12:43 ` [PATCH 06/16] nuc900fb: " Jamie Iles
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Vincent Sanders, linux-fbdev

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Vincent Sanders <support@simtec.co.uk>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/video/s3c2410fb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 46b4309..61c819e 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -13,6 +13,7 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
@@ -918,9 +919,9 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
 	}
 
 	info->clk = clk_get(NULL, "lcd");
-	if (!info->clk || IS_ERR(info->clk)) {
+	if (IS_ERR(info->clk)) {
 		printk(KERN_ERR "failed to get lcd clock source\n");
-		ret = -ENOENT;
+		ret = PTR_ERR(info->clk);
 		goto release_irq;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 06/16] nuc900fb: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (4 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 05/16] s3c2410fb: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-12  1:24   ` Wan ZongShun
  2011-01-11 12:43 ` [PATCH 07/16] staging: tidspbridge: " Jamie Iles
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Wan ZongShun, linux-fbdev

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/video/nuc900fb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
index 81687ed..62498bd 100644
--- a/drivers/video/nuc900fb.c
+++ b/drivers/video/nuc900fb.c
@@ -15,6 +15,7 @@
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
@@ -597,9 +598,9 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev)
 	}
 
 	fbi->clk = clk_get(&pdev->dev, NULL);
-	if (!fbi->clk || IS_ERR(fbi->clk)) {
+	if (IS_ERR(fbi->clk)) {
 		printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n");
-		ret = -ENOENT;
+		ret = PTR_ERR(fbi->clk);
 		goto release_irq;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 07/16] staging: tidspbridge: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (5 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 06/16] nuc900fb: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:50   ` Aaro Koskinen
  2011-01-11 12:43 ` [PATCH 08/16] ARM: samsung: serial: " Jamie Iles
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Omar Ramirez Luna, Greg Kroah-Hartman

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/staging/tidspbridge/core/wdt.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/wdt.c b/drivers/staging/tidspbridge/core/wdt.c
index 2126f59..bfbf88d 100644
--- a/drivers/staging/tidspbridge/core/wdt.c
+++ b/drivers/staging/tidspbridge/core/wdt.c
@@ -15,6 +15,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
+#include <linux/err.h>
 #include <linux/types.h>
 
 #include <dspbridge/dbdefs.h>
@@ -60,15 +61,15 @@ int dsp_wdt_init(void)
 
 	dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
 
-	if (dsp_wdt.fclk) {
+	if (!IS_ERR(dsp_wdt.fclk)) {
 		dsp_wdt.iclk = clk_get(NULL, "wdt3_ick");
-		if (!dsp_wdt.iclk) {
+		if (IS_ERR(dsp_wdt.iclk)) {
 			clk_put(dsp_wdt.fclk);
 			dsp_wdt.fclk = NULL;
-			ret = -EFAULT;
+			ret = PTR_ERR(dsp_wdt.iclk);
 		}
 	} else
-		ret = -EFAULT;
+		ret = PTR_ERR(dsp_wdt.fclk);
 
 	if (!ret)
 		ret = request_irq(INT_34XX_WDT3_IRQ, dsp_wdt_isr, 0,
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 08/16] ARM: samsung: serial: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (6 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 07/16] staging: tidspbridge: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 21:14   ` Russell King - ARM Linux
  2011-01-12  2:21   ` Kukjin Kim
  2011-01-11 12:43 ` [PATCH 09/16] ARM: pxa: " Jamie Iles
                   ` (7 subsequent siblings)
  15 siblings, 2 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Kukjin Kim, linux-arm-kernel

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/serial/samsung.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 7ac2bf5..be93d2f 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -42,6 +42,7 @@
 #include <linux/serial.h>
 #include <linux/delay.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/cpufreq.h>
 
 #include <asm/irq.h>
@@ -522,7 +523,7 @@ static int s3c24xx_serial_calcbaud(struct baud_calc *calc,
 	unsigned long rate;
 
 	calc->src = clk_get(port->dev, clksrc->name);
-	if (calc->src == NULL || IS_ERR(calc->src))
+	if (IS_ERR(calc->src))
 		return 0;
 
 	rate = clk_get_rate(calc->src);
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 09/16] ARM: pxa: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (7 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 08/16] ARM: samsung: serial: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 21:14   ` Russell King - ARM Linux
  2011-01-11 12:43 ` [PATCH 10/16] drivers/net: stmmac: " Jamie Iles
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Eric Miao, linux-arm-kernel

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/pcmcia/pxa2xx_base.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 3755e7c..6e5b55e 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -16,6 +16,7 @@
 
   ======================================================================*/
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
@@ -297,8 +298,8 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
 	}
 
 	clk = clk_get(&dev->dev, NULL);
-	if (!clk)
-		return -ENODEV;
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
 
 	pxa2xx_drv_pcmcia_ops(ops);
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 10/16] drivers/net: stmmac: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (8 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 09/16] ARM: pxa: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-12  8:00   ` Peppe CAVALLARO
  2011-01-11 12:43 ` [PATCH 11/16] drivers/net: sh_irda: " Jamie Iles
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Giuseppe Cavallaro, netdev

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/net/stmmac/stmmac_timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/stmmac/stmmac_timer.c b/drivers/net/stmmac/stmmac_timer.c
index 2a0e1ab..ebb1b37 100644
--- a/drivers/net/stmmac/stmmac_timer.c
+++ b/drivers/net/stmmac/stmmac_timer.c
@@ -91,6 +91,7 @@ int stmmac_close_ext_timer(void)
 
 #elif defined(CONFIG_STMMAC_TMU_TIMER)
 #include <linux/clk.h>
+#include <linux/err.h>
 #define TMU_CHANNEL "tmu2_clk"
 static struct clk *timer_clock;
 
@@ -109,7 +110,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm)
 {
 	timer_clock = clk_get(NULL, TMU_CHANNEL);
 
-	if (timer_clock == NULL)
+	if (IS_ERR(timer_clock))
 		return -1;
 
 	if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) {
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 11/16] drivers/net: sh_irda: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (9 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 10/16] drivers/net: stmmac: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 12:43 ` [PATCH 12/16] mtd: mpc5121_nfc: " Jamie Iles
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Samuel Ortiz, netdev

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/net/irda/sh_sir.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
index 52a7c86..56ba91a 100644
--- a/drivers/net/irda/sh_sir.c
+++ b/drivers/net/irda/sh_sir.c
@@ -12,6 +12,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
@@ -278,9 +279,9 @@ static int sh_sir_set_baudrate(struct sh_sir_self *self, u32 baudrate)
 	}
 
 	clk = clk_get(NULL, "irda_clk");
-	if (!clk) {
+	if (IS_ERR(clk)) {
 		dev_err(dev, "can not get irda_clk\n");
-		return -EIO;
+		return PTR_ERR(clk);
 	}
 
 	clk_set_rate(clk, sh_sir_find_sclk(clk));
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 12/16] mtd: mpc5121_nfc: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (10 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 11/16] drivers/net: sh_irda: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:15   ` Wolfram Sang
  2011-01-18 12:09   ` Artem Bityutskiy
  2011-01-11 12:43 ` [PATCH 13/16] MMC: jz4740: " Jamie Iles
                   ` (3 subsequent siblings)
  15 siblings, 2 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Vincent Sanders, linux-mtd

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Vincent Sanders <support@simtec.co.uk>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/mtd/nand/mpc5121_nfc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 469e649..ddaf001 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -29,6 +29,7 @@
 #include <linux/clk.h>
 #include <linux/gfp.h>
 #include <linux/delay.h>
+#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
@@ -758,9 +759,9 @@ static int __devinit mpc5121_nfc_probe(struct platform_device *op,
 
 	/* Enable NFC clock */
 	prv->clk = clk_get(dev, "nfc_clk");
-	if (!prv->clk) {
+	if (IS_ERR(prv->clk)) {
 		dev_err(dev, "Unable to acquire NFC clock!\n");
-		retval = -ENODEV;
+		retval = PTR_ERR(prv->clk);
 		goto error;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 13/16] MMC: jz4740: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (11 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 12/16] mtd: mpc5121_nfc: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 23:22   ` Chris Ball
  2011-01-11 12:43 ` [PATCH 14/16] can: mpc5xxx_can: " Jamie Iles
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, linux-mmc

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: linux-mmc@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/mmc/host/jz4740_mmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index b3a0ab0..74218ad 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -14,6 +14,7 @@
  */
 
 #include <linux/mmc/host.h>
+#include <linux/err.h>
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -827,8 +828,8 @@ static int __devinit jz4740_mmc_probe(struct platform_device* pdev)
 	}
 
 	host->clk = clk_get(&pdev->dev, "mmc");
-	if (!host->clk) {
-		ret = -ENOENT;
+	if (IS_ERR(host->clk)) {
+		ret = PTR_ERR(host->clk);
 		dev_err(&pdev->dev, "Failed to get mmc clock\n");
 		goto err_free_host;
 	}
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 14/16] can: mpc5xxx_can: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (12 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 13/16] MMC: jz4740: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:18   ` Wolfram Sang
  2011-01-11 12:43 ` [PATCH 15/16] spi: dw_spi: " Jamie Iles
  2011-01-11 12:43 ` [PATCH 16/16] w1: mxc_w1: " Jamie Iles
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, netdev

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: netdev@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/net/can/mscan/mpc5xxx_can.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 312b9c8..15377c0 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -29,6 +29,7 @@
 #include <linux/of_platform.h>
 #include <sysdev/fsl_soc.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/io.h>
 #include <asm/mpc52xx.h>
 
@@ -181,7 +182,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
 
 		if (!clock_name || !strcmp(clock_name, "sys")) {
 			sys_clk = clk_get(&ofdev->dev, "sys_clk");
-			if (!sys_clk) {
+			if (IS_ERR(sys_clk)) {
 				dev_err(&ofdev->dev, "couldn't get sys_clk\n");
 				goto exit_unmap;
 			}
@@ -204,7 +205,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
 
 		if (clocksrc < 0) {
 			ref_clk = clk_get(&ofdev->dev, "ref_clk");
-			if (!ref_clk) {
+			if (IS_ERR(ref_clk)) {
 				dev_err(&ofdev->dev, "couldn't get ref_clk\n");
 				goto exit_unmap;
 			}
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 15/16] spi: dw_spi: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (13 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 14/16] can: mpc5xxx_can: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:20   ` Grant Likely
  2011-01-11 12:43 ` [PATCH 16/16] w1: mxc_w1: " Jamie Iles
  15 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, spi-devel-general

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: spi-devel-general@lists.sourceforge.net
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/spi/dw_spi_mmio.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/dw_spi_mmio.c b/drivers/spi/dw_spi_mmio.c
index db35bd9..2fa012c 100644
--- a/drivers/spi/dw_spi_mmio.c
+++ b/drivers/spi/dw_spi_mmio.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
@@ -68,8 +69,8 @@ static int __devinit dw_spi_mmio_probe(struct platform_device *pdev)
 	}
 
 	dwsmmio->clk = clk_get(&pdev->dev, NULL);
-	if (!dwsmmio->clk) {
-		ret = -ENODEV;
+	if (IS_ERR(dwsmmio->clk)) {
+		ret = PTR_ERR(dwsmmio->clk);
 		goto err_irq;
 	}
 	clk_enable(dwsmmio->clk);
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 16/16] w1: mxc_w1: don't treat NULL clk as an error
  2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
                   ` (14 preceding siblings ...)
  2011-01-11 12:43 ` [PATCH 15/16] spi: dw_spi: " Jamie Iles
@ 2011-01-11 12:43 ` Jamie Iles
  2011-01-11 15:10   ` Sascha Hauer
  2011-01-11 21:15   ` Russell King - ARM Linux
  15 siblings, 2 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jamie Iles, Sascha Hauer, linux-arm-kernel

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/w1/masters/mxc_w1.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index a3b6a74..67ea082 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/io.h>
@@ -118,8 +119,8 @@ static int __devinit mxc_w1_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mdev->clk = clk_get(&pdev->dev, "owire");
-	if (!mdev->clk) {
-		err = -ENODEV;
+	if (IS_ERR(mdev->clk)) {
+		err = PTR_ERR(mdev->clk);
 		goto failed_clk;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 16/16] w1: mxc_w1: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 16/16] w1: mxc_w1: " Jamie Iles
@ 2011-01-11 15:10   ` Sascha Hauer
  2011-01-11 21:15   ` Russell King - ARM Linux
  1 sibling, 0 replies; 44+ messages in thread
From: Sascha Hauer @ 2011-01-11 15:10 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, linux-arm-kernel

On Tue, Jan 11, 2011 at 12:43:53PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

> ---
>  drivers/w1/masters/mxc_w1.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
> index a3b6a74..67ea082 100644
> --- a/drivers/w1/masters/mxc_w1.c
> +++ b/drivers/w1/masters/mxc_w1.c
> @@ -21,6 +21,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/platform_device.h>
>  #include <linux/clk.h>
> +#include <linux/err.h>
>  #include <linux/slab.h>
>  #include <linux/delay.h>
>  #include <linux/io.h>
> @@ -118,8 +119,8 @@ static int __devinit mxc_w1_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	mdev->clk = clk_get(&pdev->dev, "owire");
> -	if (!mdev->clk) {
> -		err = -ENODEV;
> +	if (IS_ERR(mdev->clk)) {
> +		err = PTR_ERR(mdev->clk);
>  		goto failed_clk;
>  	}
>  
> -- 
> 1.7.3.4
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 12/16] mtd: mpc5121_nfc: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 12/16] mtd: mpc5121_nfc: " Jamie Iles
@ 2011-01-11 15:15   ` Wolfram Sang
  2011-01-18 12:09   ` Artem Bityutskiy
  1 sibling, 0 replies; 44+ messages in thread
From: Wolfram Sang @ 2011-01-11 15:15 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Vincent Sanders, linux-mtd

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

On Tue, Jan 11, 2011 at 12:43:49PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Vincent Sanders <support@simtec.co.uk>
> Cc: linux-mtd@lists.infradead.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 14/16] can: mpc5xxx_can: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 14/16] can: mpc5xxx_can: " Jamie Iles
@ 2011-01-11 15:18   ` Wolfram Sang
  0 siblings, 0 replies; 44+ messages in thread
From: Wolfram Sang @ 2011-01-11 15:18 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, netdev

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

On Tue, Jan 11, 2011 at 12:43:51PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: netdev@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 15/16] spi: dw_spi: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 15/16] spi: dw_spi: " Jamie Iles
@ 2011-01-11 15:20   ` Grant Likely
  0 siblings, 0 replies; 44+ messages in thread
From: Grant Likely @ 2011-01-11 15:20 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, spi-devel-general

On Tue, Jan 11, 2011 at 12:43:52PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: spi-devel-general@lists.sourceforge.net
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Applied, thanks.

g.

> ---
>  drivers/spi/dw_spi_mmio.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/dw_spi_mmio.c b/drivers/spi/dw_spi_mmio.c
> index db35bd9..2fa012c 100644
> --- a/drivers/spi/dw_spi_mmio.c
> +++ b/drivers/spi/dw_spi_mmio.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include <linux/clk.h>
> +#include <linux/err.h>
>  #include <linux/interrupt.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> @@ -68,8 +69,8 @@ static int __devinit dw_spi_mmio_probe(struct platform_device *pdev)
>  	}
>  
>  	dwsmmio->clk = clk_get(&pdev->dev, NULL);
> -	if (!dwsmmio->clk) {
> -		ret = -ENODEV;
> +	if (IS_ERR(dwsmmio->clk)) {
> +		ret = PTR_ERR(dwsmmio->clk);
>  		goto err_irq;
>  	}
>  	clk_enable(dwsmmio->clk);
> -- 
> 1.7.3.4
> 
> 
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any company
> that requires sensitive data to be transmitted over the Web.   Learn how to 
> best implement a security strategy that keeps consumers' information secure 
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl 
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 07/16] staging: tidspbridge: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 07/16] staging: tidspbridge: " Jamie Iles
@ 2011-01-11 15:50   ` Aaro Koskinen
  2011-01-11 16:40     ` Jamie Iles
  0 siblings, 1 reply; 44+ messages in thread
From: Aaro Koskinen @ 2011-01-11 15:50 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Omar Ramirez Luna, Greg Kroah-Hartman

Hi,

On Tue, 11 Jan 2011, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
>
> Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
> drivers/staging/tidspbridge/core/wdt.c |    9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/tidspbridge/core/wdt.c b/drivers/staging/tidspbridge/core/wdt.c
> index 2126f59..bfbf88d 100644
> --- a/drivers/staging/tidspbridge/core/wdt.c
> +++ b/drivers/staging/tidspbridge/core/wdt.c
> @@ -15,6 +15,7 @@
>  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
>  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
>  */
> +#include <linux/err.h>
> #include <linux/types.h>
>
> #include <dspbridge/dbdefs.h>
> @@ -60,15 +61,15 @@ int dsp_wdt_init(void)
>
> 	dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
>
> -	if (dsp_wdt.fclk) {
> +	if (!IS_ERR(dsp_wdt.fclk)) {
> 		dsp_wdt.iclk = clk_get(NULL, "wdt3_ick");
> -		if (!dsp_wdt.iclk) {
> +		if (IS_ERR(dsp_wdt.iclk)) {
> 			clk_put(dsp_wdt.fclk);
> 			dsp_wdt.fclk = NULL;
> -			ret = -EFAULT;
> +			ret = PTR_ERR(dsp_wdt.iclk);
> 		}
> 	} else
> -		ret = -EFAULT;
> +		ret = PTR_ERR(dsp_wdt.fclk);

There are also other places in this driver where dsp_wdt.[if]clk is
checked against NULL, so this change alone is not sufficient.


> 	if (!ret)
> 		ret = request_irq(INT_34XX_WDT3_IRQ, dsp_wdt_isr, 0,
> -- 
> 1.7.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 01/16] crypto: omap-aes: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 01/16] crypto: omap-aes: don't treat NULL clk " Jamie Iles
@ 2011-01-11 15:56   ` Aaro Koskinen
  2011-01-12 14:32     ` Dmitry Kasatkin
  2011-01-12 19:38   ` Tobias Karnat
  1 sibling, 1 reply; 44+ messages in thread
From: Aaro Koskinen @ 2011-01-11 15:56 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Dmitry Kasatkin, linux-crypto

Hi,

On Tue, 11 Jan 2011, Jamie Iles wrote:

> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
>
> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
> Cc: linux-crypto@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>

> ---
> drivers/crypto/omap-aes.c |    5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
> index 799ca51..24d0f3f 100644
> --- a/drivers/crypto/omap-aes.c
> +++ b/drivers/crypto/omap-aes.c
> @@ -17,6 +17,7 @@
> #include <linux/err.h>
> #include <linux/module.h>
> #include <linux/init.h>
> +#include <linux/err.h>
> #include <linux/errno.h>
> #include <linux/kernel.h>
> #include <linux/clk.h>
> @@ -830,9 +831,9 @@ static int omap_aes_probe(struct platform_device *pdev)
>
> 	/* Initializing the clock */
> 	dd->iclk = clk_get(dev, "ick");
> -	if (!dd->iclk) {
> +	if (IS_ERR(dd->iclk)) {
> 		dev_err(dev, "clock intialization failed.\n");
> -		err = -ENODEV;
> +		err = PTR_ERR(dd->iclk);
> 		goto err_res;
> 	}
>
> -- 
> 1.7.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 02/16] crypto: omap-sham: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 02/16] crypto: omap-sham: " Jamie Iles
@ 2011-01-11 15:56   ` Aaro Koskinen
  2011-01-12 14:32     ` Dmitry Kasatkin
  0 siblings, 1 reply; 44+ messages in thread
From: Aaro Koskinen @ 2011-01-11 15:56 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Dmitry Kasatkin, linux-crypto

Hi,

On Tue, 11 Jan 2011, Jamie Iles wrote:

> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
>
> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
> Cc: linux-crypto@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>

> ---
> drivers/crypto/omap-sham.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
> index a081c7c..1acfcd2 100644
> --- a/drivers/crypto/omap-sham.c
> +++ b/drivers/crypto/omap-sham.c
> @@ -1150,9 +1150,9 @@ static int __devinit omap_sham_probe(struct platform_device *pdev)
>
> 	/* Initializing the clock */
> 	dd->iclk = clk_get(dev, "ick");
> -	if (!dd->iclk) {
> +	if (IS_ERR(dd->iclk)) {
> 		dev_err(dev, "clock intialization failed.\n");
> -		err = -ENODEV;
> +		err = PTR_ERR(dd->iclk);
> 		goto clk_err;
> 	}
>
> -- 
> 1.7.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 07/16] staging: tidspbridge: don't treat NULL clk as an error
  2011-01-11 15:50   ` Aaro Koskinen
@ 2011-01-11 16:40     ` Jamie Iles
  0 siblings, 0 replies; 44+ messages in thread
From: Jamie Iles @ 2011-01-11 16:40 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Jamie Iles, linux-kernel, Omar Ramirez Luna, Greg Kroah-Hartman

Hi Aaro,

On Tue, Jan 11, 2011 at 05:50:06PM +0200, Aaro Koskinen wrote:
> On Tue, 11 Jan 2011, Jamie Iles wrote:
[...]
> >#include <dspbridge/dbdefs.h>
> >@@ -60,15 +61,15 @@ int dsp_wdt_init(void)
> >
> >	dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
> >
> >-	if (dsp_wdt.fclk) {
> >+	if (!IS_ERR(dsp_wdt.fclk)) {
> >		dsp_wdt.iclk = clk_get(NULL, "wdt3_ick");
> >-		if (!dsp_wdt.iclk) {
> >+		if (IS_ERR(dsp_wdt.iclk)) {
> >			clk_put(dsp_wdt.fclk);
> >			dsp_wdt.fclk = NULL;
> >-			ret = -EFAULT;
> >+			ret = PTR_ERR(dsp_wdt.iclk);
> >		}
> >	} else
> >-		ret = -EFAULT;
> >+		ret = PTR_ERR(dsp_wdt.fclk);
> 
> There are also other places in this driver where dsp_wdt.[if]clk is
> checked against NULL, so this change alone is not sufficient.

Yes, you're quite right.

On closer inspection it looks to me like the error handling in 
drivers/staging/tidspbridge/io_sm.c::bridge_io_create needs to be fixed 
up first otherwise we can end up calling dsp_wdt_exit() through 
bridge_io_destroy() without the contents of dsp_wdt being coherently 
initialized (there are also failure paths where the wdt irq and tasklet 
can be freed/killed without first being setup).

Jamie

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 08/16] ARM: samsung: serial: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 08/16] ARM: samsung: serial: " Jamie Iles
@ 2011-01-11 21:14   ` Russell King - ARM Linux
  2011-01-12  2:21   ` Kukjin Kim
  1 sibling, 0 replies; 44+ messages in thread
From: Russell King - ARM Linux @ 2011-01-11 21:14 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Kukjin Kim, linux-arm-kernel

On Tue, Jan 11, 2011 at 12:43:45PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

> 
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 09/16] ARM: pxa: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 09/16] ARM: pxa: " Jamie Iles
@ 2011-01-11 21:14   ` Russell King - ARM Linux
  0 siblings, 0 replies; 44+ messages in thread
From: Russell King - ARM Linux @ 2011-01-11 21:14 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Eric Miao, linux-arm-kernel

On Tue, Jan 11, 2011 at 12:43:46PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.

Good catch.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 16/16] w1: mxc_w1: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 16/16] w1: mxc_w1: " Jamie Iles
  2011-01-11 15:10   ` Sascha Hauer
@ 2011-01-11 21:15   ` Russell King - ARM Linux
  1 sibling, 0 replies; 44+ messages in thread
From: Russell King - ARM Linux @ 2011-01-11 21:15 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Sascha Hauer, linux-arm-kernel

On Tue, Jan 11, 2011 at 12:43:53PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.

Another good catch.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

Thanks for doing this.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 13/16] MMC: jz4740: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 13/16] MMC: jz4740: " Jamie Iles
@ 2011-01-11 23:22   ` Chris Ball
  0 siblings, 0 replies; 44+ messages in thread
From: Chris Ball @ 2011-01-11 23:22 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, linux-mmc

Hi Jamie,

On Tue, Jan 11, 2011 at 12:43:50PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: linux-mmc@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
>  drivers/mmc/host/jz4740_mmc.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
> index b3a0ab0..74218ad 100644
> --- a/drivers/mmc/host/jz4740_mmc.c
> +++ b/drivers/mmc/host/jz4740_mmc.c
> @@ -14,6 +14,7 @@
>   */
>  
>  #include <linux/mmc/host.h>
> +#include <linux/err.h>
>  #include <linux/io.h>
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
> @@ -827,8 +828,8 @@ static int __devinit jz4740_mmc_probe(struct platform_device* pdev)
>  	}
>  
>  	host->clk = clk_get(&pdev->dev, "mmc");
> -	if (!host->clk) {
> -		ret = -ENOENT;
> +	if (IS_ERR(host->clk)) {
> +		ret = PTR_ERR(host->clk);
>  		dev_err(&pdev->dev, "Failed to get mmc clock\n");
>  		goto err_free_host;
>  	}

Thanks, pushed to mmc-next and queued as a .38 fix.

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 06/16] nuc900fb: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 06/16] nuc900fb: " Jamie Iles
@ 2011-01-12  1:24   ` Wan ZongShun
  2011-01-12  6:00     ` Paul Mundt
  0 siblings, 1 reply; 44+ messages in thread
From: Wan ZongShun @ 2011-01-12  1:24 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, linux-fbdev, linux-arm-kernel

2011/1/11 Jamie Iles <jamie@jamieiles.com>:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
>
> Cc: Wan ZongShun <mcuos.com@gmail.com>
> Cc: linux-fbdev@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
>  drivers/video/nuc900fb.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
> index 81687ed..62498bd 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -15,6 +15,7 @@
>  */
>  #include <linux/module.h>
>  #include <linux/kernel.h>
> +#include <linux/err.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
>  #include <linux/mm.h>
> @@ -597,9 +598,9 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev)
>        }
>
>        fbi->clk = clk_get(&pdev->dev, NULL);
> -       if (!fbi->clk || IS_ERR(fbi->clk)) {
> +       if (IS_ERR(fbi->clk)) {
>                printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n");
> -               ret = -ENOENT;
> +               ret = PTR_ERR(fbi->clk);
>                goto release_irq;
>        }
>
Hi,

Thanks for your patch.

Acked-by: Wan ZongShun <mcuos.com@gmail.com>

> --
> 1.7.3.4
>
>



-- 
*linux-arm-kernel mailing list
mail addr:linux-arm-kernel@lists.infradead.org
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

* linux-arm-NUC900 mailing list
mail addr:NUC900@googlegroups.com
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuos.com@gmail.com

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH 08/16] ARM: samsung: serial: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 08/16] ARM: samsung: serial: " Jamie Iles
  2011-01-11 21:14   ` Russell King - ARM Linux
@ 2011-01-12  2:21   ` Kukjin Kim
  1 sibling, 0 replies; 44+ messages in thread
From: Kukjin Kim @ 2011-01-12  2:21 UTC (permalink / raw)
  To: 'Jamie Iles', linux-kernel; +Cc: linux-arm-kernel

Jamie Iles wrote:
> 
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
>  drivers/serial/samsung.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
> index 7ac2bf5..be93d2f 100644
> --- a/drivers/serial/samsung.c
> +++ b/drivers/serial/samsung.c
> @@ -42,6 +42,7 @@
>  #include <linux/serial.h>
>  #include <linux/delay.h>
>  #include <linux/clk.h>
> +#include <linux/err.h>
>  #include <linux/cpufreq.h>
> 
>  #include <asm/irq.h>
> @@ -522,7 +523,7 @@ static int s3c24xx_serial_calcbaud(struct baud_calc
*calc,
>  	unsigned long rate;
> 
>  	calc->src = clk_get(port->dev, clksrc->name);
> -	if (calc->src == NULL || IS_ERR(calc->src))
> +	if (IS_ERR(calc->src))
>  		return 0;
> 
>  	rate = clk_get_rate(calc->src);
> --
1.7.3.4


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 04/16] input: tnetv107x-touchscreen: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 04/16] input: tnetv107x-touchscreen: " Jamie Iles
@ 2011-01-12  5:56   ` Dmitry Torokhov
  2011-01-18  4:25     ` Dmitry Torokhov
  0 siblings, 1 reply; 44+ messages in thread
From: Dmitry Torokhov @ 2011-01-12  5:56 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Cyril Chemparathy, linux-input

On Tue, Jan 11, 2011 at 12:43:41PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Cyril Chemparathy <cyril@ti.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Applied both, thank you Jamie.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 05/16] s3c2410fb: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 05/16] s3c2410fb: " Jamie Iles
@ 2011-01-12  6:00   ` Paul Mundt
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Mundt @ 2011-01-12  6:00 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Vincent Sanders, linux-fbdev

On Tue, Jan 11, 2011 at 12:43:42PM +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Vincent Sanders <support@simtec.co.uk>
> Cc: linux-fbdev@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 06/16] nuc900fb: don't treat NULL clk as an error
  2011-01-12  1:24   ` Wan ZongShun
@ 2011-01-12  6:00     ` Paul Mundt
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Mundt @ 2011-01-12  6:00 UTC (permalink / raw)
  To: Wan ZongShun; +Cc: Jamie Iles, linux-kernel, linux-fbdev, linux-arm-kernel

On Wed, Jan 12, 2011 at 09:24:47AM +0800, Wan ZongShun wrote:
> 2011/1/11 Jamie Iles <jamie@jamieiles.com>:
> > clk_get() returns a struct clk cookie to the driver and some platforms
> > may return NULL if they only support a single clock. ??clk_get() has only
> > failed if it returns a ERR_PTR() encoded pointer.
> >
> > Cc: Wan ZongShun <mcuos.com@gmail.com>
> > Cc: linux-fbdev@vger.kernel.org
> > Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> 
> Thanks for your patch.
> 
> Acked-by: Wan ZongShun <mcuos.com@gmail.com>
> 
Applied, thanks.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 10/16] drivers/net: stmmac: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 10/16] drivers/net: stmmac: " Jamie Iles
@ 2011-01-12  8:00   ` Peppe CAVALLARO
  0 siblings, 0 replies; 44+ messages in thread
From: Peppe CAVALLARO @ 2011-01-12  8:00 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, netdev

Hello

On 1/11/2011 1:43 PM, Jamie Iles wrote:
>
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
>
Thanks for the patch that actually useful.
I'm going to rework this part of the driver.
At any rate, all my new changes can be done on top of this patch.

Regards,
Peppe
>
>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
>  drivers/net/stmmac/stmmac_timer.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/stmmac/stmmac_timer.c
> b/drivers/net/stmmac/stmmac_timer.c
> index 2a0e1ab..ebb1b37 100644
> --- a/drivers/net/stmmac/stmmac_timer.c
> +++ b/drivers/net/stmmac/stmmac_timer.c
> @@ -91,6 +91,7 @@ int stmmac_close_ext_timer(void)
>
>  #elif defined(CONFIG_STMMAC_TMU_TIMER)
>  #include <linux/clk.h>
> +#include <linux/err.h>
>  #define TMU_CHANNEL "tmu2_clk"
>  static struct clk *timer_clock;
>
> @@ -109,7 +110,7 @@ int stmmac_open_ext_timer(struct net_device *dev,
> struct stmmac_timer *tm)
>  {
>         timer_clock = clk_get(NULL, TMU_CHANNEL);
>
> -       if (timer_clock == NULL)
> +       if (IS_ERR(timer_clock))
>                 return -1;
>
>         if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) {
> --
> 1.7.3.4
>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 01/16] crypto: omap-aes: don't treat NULL clk as an error
  2011-01-11 15:56   ` Aaro Koskinen
@ 2011-01-12 14:32     ` Dmitry Kasatkin
  0 siblings, 0 replies; 44+ messages in thread
From: Dmitry Kasatkin @ 2011-01-12 14:32 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Jamie Iles, linux-kernel, linux-crypto

Hi,

Indeed, thanks

On 11/01/11 17:56, Aaro Koskinen wrote:
> Hi,
>
> On Tue, 11 Jan 2011, Jamie Iles wrote:
>
>> clk_get() returns a struct clk cookie to the driver and some platforms
>> may return NULL if they only support a single clock.  clk_get() has only
>> failed if it returns a ERR_PTR() encoded pointer.
>>
>> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
>> Cc: linux-crypto@vger.kernel.org
>> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
>
> Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Reviewed-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
>
>> ---
>> drivers/crypto/omap-aes.c |    5 +++--
>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
>> index 799ca51..24d0f3f 100644
>> --- a/drivers/crypto/omap-aes.c
>> +++ b/drivers/crypto/omap-aes.c
>> @@ -17,6 +17,7 @@
>> #include <linux/err.h>
>> #include <linux/module.h>
>> #include <linux/init.h>
>> +#include <linux/err.h>
>> #include <linux/errno.h>
>> #include <linux/kernel.h>
>> #include <linux/clk.h>
>> @@ -830,9 +831,9 @@ static int omap_aes_probe(struct platform_device
>> *pdev)
>>
>>     /* Initializing the clock */
>>     dd->iclk = clk_get(dev, "ick");
>> -    if (!dd->iclk) {
>> +    if (IS_ERR(dd->iclk)) {
>>         dev_err(dev, "clock intialization failed.\n");
>> -        err = -ENODEV;
>> +        err = PTR_ERR(dd->iclk);
>>         goto err_res;
>>     }
>>
>> -- 
>> 1.7.3.4
>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 02/16] crypto: omap-sham: don't treat NULL clk as an error
  2011-01-11 15:56   ` Aaro Koskinen
@ 2011-01-12 14:32     ` Dmitry Kasatkin
  2011-01-29  5:01       ` Herbert Xu
  0 siblings, 1 reply; 44+ messages in thread
From: Dmitry Kasatkin @ 2011-01-12 14:32 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Jamie Iles, linux-kernel, linux-crypto

Thanks.


On 11/01/11 17:56, Aaro Koskinen wrote:
> Hi,
>
> On Tue, 11 Jan 2011, Jamie Iles wrote:
>
>> clk_get() returns a struct clk cookie to the driver and some platforms
>> may return NULL if they only support a single clock.  clk_get() has only
>> failed if it returns a ERR_PTR() encoded pointer.
>>
>> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
>> Cc: linux-crypto@vger.kernel.org
>> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
>
> Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>
>
Reviewed-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
>> ---
>> drivers/crypto/omap-sham.c |    4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
>> index a081c7c..1acfcd2 100644
>> --- a/drivers/crypto/omap-sham.c
>> +++ b/drivers/crypto/omap-sham.c
>> @@ -1150,9 +1150,9 @@ static int __devinit omap_sham_probe(struct
>> platform_device *pdev)
>>
>>     /* Initializing the clock */
>>     dd->iclk = clk_get(dev, "ick");
>> -    if (!dd->iclk) {
>> +    if (IS_ERR(dd->iclk)) {
>>         dev_err(dev, "clock intialization failed.\n");
>> -        err = -ENODEV;
>> +        err = PTR_ERR(dd->iclk);
>>         goto clk_err;
>>     }
>>
>> -- 
>> 1.7.3.4
>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 01/16] crypto: omap-aes: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 01/16] crypto: omap-aes: don't treat NULL clk " Jamie Iles
  2011-01-11 15:56   ` Aaro Koskinen
@ 2011-01-12 19:38   ` Tobias Karnat
  2011-01-12 21:51     ` Jamie Iles
  1 sibling, 1 reply; 44+ messages in thread
From: Tobias Karnat @ 2011-01-12 19:38 UTC (permalink / raw)
  To: Jamie Iles; +Cc: Dmitry Kasatkin, Aaro Koskinen, linux-kernel, linux-crypto

Hi,

You have included linux/err.h a second time.

-Tobias

Am Dienstag, den 11.01.2011, 12:43 +0000 schrieb Jamie Iles:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
> Cc: linux-crypto@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
>  drivers/crypto/omap-aes.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
> index 799ca51..24d0f3f 100644
> --- a/drivers/crypto/omap-aes.c
> +++ b/drivers/crypto/omap-aes.c
> @@ -17,6 +17,7 @@
>  #include <linux/err.h>
>  #include <linux/module.h>
>  #include <linux/init.h>
> +#include <linux/err.h>
>  #include <linux/errno.h>
>  #include <linux/kernel.h>
>  #include <linux/clk.h>
> @@ -830,9 +831,9 @@ static int omap_aes_probe(struct platform_device *pdev)
>  
>  	/* Initializing the clock */
>  	dd->iclk = clk_get(dev, "ick");
> -	if (!dd->iclk) {
> +	if (IS_ERR(dd->iclk)) {
>  		dev_err(dev, "clock intialization failed.\n");
> -		err = -ENODEV;
> +		err = PTR_ERR(dd->iclk);
>  		goto err_res;
>  	}
>  



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 01/16] crypto: omap-aes: don't treat NULL clk as an error
  2011-01-12 19:38   ` Tobias Karnat
@ 2011-01-12 21:51     ` Jamie Iles
  2011-01-13  2:25       ` Tobias Karnat
  0 siblings, 1 reply; 44+ messages in thread
From: Jamie Iles @ 2011-01-12 21:51 UTC (permalink / raw)
  To: Tobias Karnat
  Cc: Jamie Iles, Dmitry Kasatkin, Aaro Koskinen, linux-kernel, linux-crypto

On Wed, Jan 12, 2011 at 08:38:55PM +0100, Tobias Karnat wrote:
> You have included linux/err.h a second time.

Doh!  Good spot, thanks.  I've checked the rest of the series and this 
was the only patch with the duplicated include.

Jamie

8<-------------------------------------------------------------------

>From 75cef47f02ea19b94203f287eaaddc644c51ce30 Mon Sep 17 00:00:00 2001
From: Jamie Iles <jamie@jamieiles.com>
Date: Tue, 11 Jan 2011 09:48:26 +0000
Subject: [PATCH] crypto: omap-aes: don't treat NULL clk as an error

clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/crypto/omap-aes.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 799ca51..10a9180 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -830,9 +830,9 @@ static int omap_aes_probe(struct platform_device *pdev)
 
 	/* Initializing the clock */
 	dd->iclk = clk_get(dev, "ick");
-	if (!dd->iclk) {
+	if (IS_ERR(dd->iclk)) {
 		dev_err(dev, "clock intialization failed.\n");
-		err = -ENODEV;
+		err = PTR_ERR(dd->iclk);
 		goto err_res;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 01/16] crypto: omap-aes: don't treat NULL clk as an error
  2011-01-12 21:51     ` Jamie Iles
@ 2011-01-13  2:25       ` Tobias Karnat
  0 siblings, 0 replies; 44+ messages in thread
From: Tobias Karnat @ 2011-01-13  2:25 UTC (permalink / raw)
  To: Jamie Iles; +Cc: Dmitry Kasatkin, Aaro Koskinen, linux-kernel, linux-crypto

Am Mittwoch, den 12.01.2011, 21:51 +0000 schrieb Jamie Iles:
> Doh!  Good spot, thanks.  I've checked the rest of the series and this 
> was the only patch with the duplicated include.

It can happen, thanks.

-Tobias

> 8<-------------------------------------------------------------------
> 
> >From 75cef47f02ea19b94203f287eaaddc644c51ce30 Mon Sep 17 00:00:00 2001
> From: Jamie Iles <jamie@jamieiles.com>
> Date: Tue, 11 Jan 2011 09:48:26 +0000
> Subject: [PATCH] crypto: omap-aes: don't treat NULL clk as an error
> 
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
> Cc: linux-crypto@vger.kernel.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-and-tested-by: Tobias Karnat <tobias.karnat@googlemail.com>
> ---
>  drivers/crypto/omap-aes.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
> index 799ca51..10a9180 100644
> --- a/drivers/crypto/omap-aes.c
> +++ b/drivers/crypto/omap-aes.c
> @@ -830,9 +830,9 @@ static int omap_aes_probe(struct platform_device *pdev)
>  
>  	/* Initializing the clock */
>  	dd->iclk = clk_get(dev, "ick");
> -	if (!dd->iclk) {
> +	if (IS_ERR(dd->iclk)) {
>  		dev_err(dev, "clock intialization failed.\n");
> -		err = -ENODEV;
> +		err = PTR_ERR(dd->iclk);
>  		goto err_res;
>  	}
>  


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 04/16] input: tnetv107x-touchscreen: don't treat NULL clk as an error
  2011-01-12  5:56   ` Dmitry Torokhov
@ 2011-01-18  4:25     ` Dmitry Torokhov
  2011-01-18  4:35       ` Dmitry Torokhov
  0 siblings, 1 reply; 44+ messages in thread
From: Dmitry Torokhov @ 2011-01-18  4:25 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Cyril Chemparathy, linux-input

On Tue, Jan 11, 2011 at 09:56:41PM -0800, Dmitry Torokhov wrote:
> On Tue, Jan 11, 2011 at 12:43:41PM +0000, Jamie Iles wrote:
> > clk_get() returns a struct clk cookie to the driver and some platforms
> > may return NULL if they only support a single clock.  clk_get() has only
> > failed if it returns a ERR_PTR() encoded pointer.
> > 
> > Cc: Cyril Chemparathy <cyril@ti.com>
> > Cc: linux-input@vger.kernel.org
> > Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> 
> Applied both, thank you Jamie.
> 

Actually, if we pass clk that is NULL along we going to get oops on many
arches, so I am going to change it to IS_ERR_OR_NULL.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 04/16] input: tnetv107x-touchscreen: don't treat NULL clk as an error
  2011-01-18  4:25     ` Dmitry Torokhov
@ 2011-01-18  4:35       ` Dmitry Torokhov
  0 siblings, 0 replies; 44+ messages in thread
From: Dmitry Torokhov @ 2011-01-18  4:35 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Cyril Chemparathy, linux-input

On Mon, Jan 17, 2011 at 08:25:35PM -0800, Dmitry Torokhov wrote:
> On Tue, Jan 11, 2011 at 09:56:41PM -0800, Dmitry Torokhov wrote:
> > On Tue, Jan 11, 2011 at 12:43:41PM +0000, Jamie Iles wrote:
> > > clk_get() returns a struct clk cookie to the driver and some platforms
> > > may return NULL if they only support a single clock.  clk_get() has only
> > > failed if it returns a ERR_PTR() encoded pointer.
> > > 
> > > Cc: Cyril Chemparathy <cyril@ti.com>
> > > Cc: linux-input@vger.kernel.org
> > > Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> > 
> > Applied both, thank you Jamie.
> > 
> 
> Actually, if we pass clk that is NULL along we going to get oops on many
> arches, so I am going to change it to IS_ERR_OR_NULL.
> 

Oh, wait... OK, I got confused by the changelog. IS_ERR is proper,
sorry.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 12/16] mtd: mpc5121_nfc: don't treat NULL clk as an error
  2011-01-11 12:43 ` [PATCH 12/16] mtd: mpc5121_nfc: " Jamie Iles
  2011-01-11 15:15   ` Wolfram Sang
@ 2011-01-18 12:09   ` Artem Bityutskiy
  1 sibling, 0 replies; 44+ messages in thread
From: Artem Bityutskiy @ 2011-01-18 12:09 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-kernel, Vincent Sanders, linux-mtd

On Tue, 2011-01-11 at 12:43 +0000, Jamie Iles wrote:
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock.  clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
> 
> Cc: Vincent Sanders <support@simtec.co.uk>
> Cc: linux-mtd@lists.infradead.org
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Pushed to l2-mtd-2.6.git, thanks.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 02/16] crypto: omap-sham: don't treat NULL clk as an error
  2011-01-12 14:32     ` Dmitry Kasatkin
@ 2011-01-29  5:01       ` Herbert Xu
  0 siblings, 0 replies; 44+ messages in thread
From: Herbert Xu @ 2011-01-29  5:01 UTC (permalink / raw)
  To: Dmitry Kasatkin; +Cc: Aaro Koskinen, Jamie Iles, linux-kernel, linux-crypto

On Wed, Jan 12, 2011 at 02:32:50PM +0000, Dmitry Kasatkin wrote:
>
> >> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
> >> Cc: linux-crypto@vger.kernel.org
> >> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> >
> > Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>
> >
> Reviewed-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>

Both pathces applied.

Thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2011-01-29  5:02 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-11 12:43 [PATCH 00/16] don't treat NULL from clk_get() as an error Jamie Iles
2011-01-11 12:43 ` [PATCH 01/16] crypto: omap-aes: don't treat NULL clk " Jamie Iles
2011-01-11 15:56   ` Aaro Koskinen
2011-01-12 14:32     ` Dmitry Kasatkin
2011-01-12 19:38   ` Tobias Karnat
2011-01-12 21:51     ` Jamie Iles
2011-01-13  2:25       ` Tobias Karnat
2011-01-11 12:43 ` [PATCH 02/16] crypto: omap-sham: " Jamie Iles
2011-01-11 15:56   ` Aaro Koskinen
2011-01-12 14:32     ` Dmitry Kasatkin
2011-01-29  5:01       ` Herbert Xu
2011-01-11 12:43 ` [PATCH 03/16] input: tnetv107x-keypad: " Jamie Iles
2011-01-11 12:43 ` [PATCH 04/16] input: tnetv107x-touchscreen: " Jamie Iles
2011-01-12  5:56   ` Dmitry Torokhov
2011-01-18  4:25     ` Dmitry Torokhov
2011-01-18  4:35       ` Dmitry Torokhov
2011-01-11 12:43 ` [PATCH 05/16] s3c2410fb: " Jamie Iles
2011-01-12  6:00   ` Paul Mundt
2011-01-11 12:43 ` [PATCH 06/16] nuc900fb: " Jamie Iles
2011-01-12  1:24   ` Wan ZongShun
2011-01-12  6:00     ` Paul Mundt
2011-01-11 12:43 ` [PATCH 07/16] staging: tidspbridge: " Jamie Iles
2011-01-11 15:50   ` Aaro Koskinen
2011-01-11 16:40     ` Jamie Iles
2011-01-11 12:43 ` [PATCH 08/16] ARM: samsung: serial: " Jamie Iles
2011-01-11 21:14   ` Russell King - ARM Linux
2011-01-12  2:21   ` Kukjin Kim
2011-01-11 12:43 ` [PATCH 09/16] ARM: pxa: " Jamie Iles
2011-01-11 21:14   ` Russell King - ARM Linux
2011-01-11 12:43 ` [PATCH 10/16] drivers/net: stmmac: " Jamie Iles
2011-01-12  8:00   ` Peppe CAVALLARO
2011-01-11 12:43 ` [PATCH 11/16] drivers/net: sh_irda: " Jamie Iles
2011-01-11 12:43 ` [PATCH 12/16] mtd: mpc5121_nfc: " Jamie Iles
2011-01-11 15:15   ` Wolfram Sang
2011-01-18 12:09   ` Artem Bityutskiy
2011-01-11 12:43 ` [PATCH 13/16] MMC: jz4740: " Jamie Iles
2011-01-11 23:22   ` Chris Ball
2011-01-11 12:43 ` [PATCH 14/16] can: mpc5xxx_can: " Jamie Iles
2011-01-11 15:18   ` Wolfram Sang
2011-01-11 12:43 ` [PATCH 15/16] spi: dw_spi: " Jamie Iles
2011-01-11 15:20   ` Grant Likely
2011-01-11 12:43 ` [PATCH 16/16] w1: mxc_w1: " Jamie Iles
2011-01-11 15:10   ` Sascha Hauer
2011-01-11 21:15   ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).