[i2c] [PATCH] Replace dev_warn with printk in pca-algo

Wolfram Sang w.sang at pengutronix.de
Mon Mar 10 14:29:09 CET 2008


Hello,

this patch needs to be applied on top of my patch
'i2c-pca-algo_extensions.diff'.

Bye,

   Wolfram

===

Subject: Replace dev_warn with printk in pca-algo
From: Wolfram Sang <w.sang at pengutronix.de>

Replace dev_warn as it would be executed before the device is registered.

Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
---
 drivers/i2c/algos/i2c-algo-pca.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-playground/drivers/i2c/algos/i2c-algo-pca.c
===================================================================
--- linux-playground.orig/drivers/i2c/algos/i2c-algo-pca.c	2008-03-10 14:10:59.000000000 +0100
+++ linux-playground/drivers/i2c/algos/i2c-algo-pca.c	2008-03-10 14:15:36.000000000 +0100
@@ -337,7 +337,9 @@
 	struct i2c_algo_pca_data *pca_data = adap->algo_data;
 
 	if (pca_data->i2c_clock > 7) {
-		dev_warn(&adap->dev, "Invalid I2C clock speed selected. Trying default.\n");
+		printk(KERN_WARNING "%s: Invalid I2C clock speed selected. Trying default.\n",
+			adap->name);
 		pca_data->i2c_clock = I2C_PCA_CON_59kHz;
 	}
 

-- 
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20080310/7d3f0de7/attachment-0001.bin 


More information about the i2c mailing list