Skip to contentSkip to conversation

Replace dev_warn with printk in pca-algo

PATCH In review Wolfram Sang 2 participants 2 messages Mar 10, 2008 1 message not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Replace dev_warn with printk in pca-algo

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 <[email protected]>

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

---
 drivers/i2c/algos/i2c-algo-pca.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/algos/i2c-algo-pca.c +2 -1
Index: linux-playground/drivers/i2c/algos/i2c-algo-pca.c
===================================================================
@@ -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;
 	}
 
Signature · 2 lines
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 26 lines · Wolfram Sang

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 <[email protected]>

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

---
 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
===================================================================

drivers/i2c/algos/i2c-algo-pca.c line 344

Quoted 9 lines
drivers/i2c/algos/i2c-algo-pca.c +2 -1
@@ -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;
 	}
 

Folded into i2c-pca-02-extension-of-pca-algorithm.patch. I had to fix the patch header to get it to apply, please pay attention next time...

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c