[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1294749833-32019-12-git-send-email-jamie@jamieiles.com>
Date: Tue, 11 Jan 2011 12:43:48 +0000
From: Jamie Iles <jamie@...ieiles.com>
To: linux-kernel@...r.kernel.org
Cc: Jamie Iles <jamie@...ieiles.com>, Samuel Ortiz <samuel@...tiz.org>,
netdev@...r.kernel.org
Subject: [PATCH 11/16] drivers/net: sh_irda: 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: Samuel Ortiz <samuel@...tiz.org>
Cc: netdev@...r.kernel.org
Signed-off-by: Jamie Iles <jamie@...ieiles.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists