Skip to contentSkip to conversation

can: mcp251x: Move diagnostic messages to dev_dbg()

PATCH Applied Alexander Shiyan 3 participants 7 messages Feb 22, 2014 – Feb 26, 2014 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 can: mcp251x: Move diagnostic messages to dev_dbg()

This patch moves diagnostic messages used for debugging purposes to dev_dbg().

---
 drivers/net/can/mcp251x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/can/mcp251x.c +5 -5
index cdb9808..56e38a6 100644
@@ -601,10 +601,10 @@ static int mcp251x_do_set_bittiming(struct net_device *net)
 			  (bt->prop_seg - 1));
 	mcp251x_write_bits(spi, CNF3, CNF3_PHSEG2_MASK,
 			   (bt->phase_seg2 - 1));
-	dev_info(&spi->dev, "CNF: 0x%02x 0x%02x 0x%02x\n",
-		 mcp251x_read_reg(spi, CNF1),
-		 mcp251x_read_reg(spi, CNF2),
-		 mcp251x_read_reg(spi, CNF3));
+	dev_dbg(&spi->dev, "CNF: 0x%02x 0x%02x 0x%02x\n",
+		mcp251x_read_reg(spi, CNF1),
+		mcp251x_read_reg(spi, CNF2),
+		mcp251x_read_reg(spi, CNF3));
 
 	return 0;
 }
@@ -1155,7 +1155,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 	devm_can_led_init(net);
 
-	dev_info(&spi->dev, "probed\n");
+	dev_dbg(&spi->dev, "probed\n");
 
 	return ret;
 
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 2/2 can: mcp251x: Remove #ifdef CONFIG_PM_SLEEP

This patch removes #ifdef CONFIG_PM_SLEEP to improve compile coverage.

---
 drivers/net/can/mcp251x.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/can/mcp251x.c +2 -5
index 56e38a6..2ac02c7 100644
@@ -1197,9 +1197,7 @@ static int mcp251x_can_remove(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-
-static int mcp251x_can_suspend(struct device *dev)
+static int __maybe_unused mcp251x_can_suspend(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct mcp251x_priv *priv = spi_get_drvdata(spi);
@@ -1229,7 +1227,7 @@ static int mcp251x_can_suspend(struct device *dev)
 	return 0;
 }
 
-static int mcp251x_can_resume(struct device *dev)
+static int __maybe_unused mcp251x_can_resume(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct mcp251x_priv *priv = spi_get_drvdata(spi);
@@ -1249,7 +1247,6 @@ static int mcp251x_can_resume(struct device *dev)
 	enable_irq(spi->irq);
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(mcp251x_can_pm_ops, mcp251x_can_suspend,
 	mcp251x_can_resume);
Signature · 1 line
1.8.3.2
#3 lore raw
In reply to Alexander Shiyan
Quoted 17 lines · Alexander Shiyan

This patch moves diagnostic messages used for debugging purposes to dev_dbg().

---
 drivers/net/can/mcp251x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/can/mcp251x.c +0 -1
index cdb9808..56e38a6 100644
@@ -601,10 +601,10 @@ static int mcp251x_do_set_bittiming(struct net_device *net)
 			  (bt->prop_seg - 1));
 	mcp251x_write_bits(spi, CNF3, CNF3_PHSEG2_MASK,
 			   (bt->phase_seg2 - 1));
-	dev_info(&spi->dev, "CNF: 0x%02x 0x%02x 0x%02x\n",

drivers/net/can/mcp251x.c static int mcp251x_do_set_bittiming(struct net_device *net) · line 610

Quoted 10 lines
drivers/net/can/mcp251x.c +4 -3
-		 mcp251x_read_reg(spi, CNF1),
-		 mcp251x_read_reg(spi, CNF2),
-		 mcp251x_read_reg(spi, CNF3));
+	dev_dbg(&spi->dev, "CNF: 0x%02x 0x%02x 0x%02x\n",
+		mcp251x_read_reg(spi, CNF1),
+		mcp251x_read_reg(spi, CNF2),
+		mcp251x_read_reg(spi, CNF3));
 
 	return 0;
 }

It's common practice to show the bit-timing settings in the kernel log. Therefore I prefer to keep this useful dev_info. If we change it, we should update all other drivers as well.

drivers/net/can/mcp251x.c static int mcp251x_can_probe(struct spi_device *spi) · line 1159

Quoted 7 lines
drivers/net/can/mcp251x.c +1 -1
@@ -1155,7 +1155,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 
 	devm_can_led_init(net);
 
-	dev_info(&spi->dev, "probed\n");
+	dev_dbg(&spi->dev, "probed\n");

This one could even be removed.

Wolfgang.

maintainer Applied
#2 lore raw

Re: [PATCH 2/2] can: mcp251x: Remove #ifdef CONFIG_PM_SLEEP

In reply to Alexander Shiyan
Quoted 4 lines · Alexander Shiyan

This patch removes #ifdef CONFIG_PM_SLEEP to improve compile coverage.

Applied to can-next.

Tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#4 lore raw
In reply to Wolfgang Grandegger
Quoted 26 lines · Wolfgang Grandegger
Quoted 25 lines · Alexander Shiyan

This patch moves diagnostic messages used for debugging purposes to dev_dbg().

---
 drivers/net/can/mcp251x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/can/mcp251x.c +4 -4
index cdb9808..56e38a6 100644
@@ -601,10 +601,10 @@ static int mcp251x_do_set_bittiming(struct net_device *net)
 			  (bt->prop_seg - 1));
 	mcp251x_write_bits(spi, CNF3, CNF3_PHSEG2_MASK,
 			   (bt->phase_seg2 - 1));
-	dev_info(&spi->dev, "CNF: 0x%02x 0x%02x 0x%02x\n",
-		 mcp251x_read_reg(spi, CNF1),
-		 mcp251x_read_reg(spi, CNF2),
-		 mcp251x_read_reg(spi, CNF3));
+	dev_dbg(&spi->dev, "CNF: 0x%02x 0x%02x 0x%02x\n",
+		mcp251x_read_reg(spi, CNF1),
+		mcp251x_read_reg(spi, CNF2),
+		mcp251x_read_reg(spi, CNF3));
 
Quoted 6 lines

drivers/net/can/mcp251x.c static int mcp251x_do_set_bittiming(struct net_device *net) · line 610

Quoted 2 lines
drivers/net/can/mcp251x.c +0 -0
 	return 0;
 }

It's common practice to show the bit-timing settings in the kernel log. Therefore I prefer to keep this useful dev_info. If we change it, we should update all other drivers as well.

I'm not sure if the output is needed. The bit timing algorithm seems to work so I think it's okay to make the driver more quiet.

Quoted 9 lines

drivers/net/can/mcp251x.c static int mcp251x_can_probe(struct spi_device *spi) · line 1159

Quoted 7 lines
drivers/net/can/mcp251x.c +1 -1
@@ -1155,7 +1155,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 
 	devm_can_led_init(net);
 
-	dev_info(&spi->dev, "probed\n");
+	dev_dbg(&spi->dev, "probed\n");

This one could even be removed.

+1

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#5 lore raw

Вторник, 25 февраля 2014, 21:41 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Alexander Shiyan
Quoted 2 lines

This patch moves diagnostic messages used for debugging purposes to dev_dbg().

...

Quoted 11 lines
Quoted 9 lines

drivers/net/can/mcp251x.c static int mcp251x_can_probe(struct spi_device *spi) · line 1159

Quoted 7 lines
drivers/net/can/mcp251x.c +1 -1
@@ -1155,7 +1155,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 
 	devm_can_led_init(net);
 
-	dev_info(&spi->dev, "probed\n");
+	dev_dbg(&spi->dev, "probed\n");

This one could even be removed.

+1

Resend this one modified patch?

---

#6 lore raw
Quoted 11 lines · Alexander Shiyan

Вторник, 25 февраля 2014, 21:41 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Alexander Shiyan
Quoted 2 lines

This patch moves diagnostic messages used for debugging purposes to dev_dbg().

...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/net/can/mcp251x.c +0 -0
@@ -1155,7 +1155,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 
 	devm_can_led_init(net);
 
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

drivers/net/can/mcp251x.c static int mcp251x_can_probe(struct spi_device *spi) · line 1158

Quoted 2 lines
drivers/net/can/mcp251x.c +1 -1
-	dev_info(&spi->dev, "probed\n");
+	dev_dbg(&spi->dev, "probed\n");

This one could even be removed.

+1

Resend this one modified patch?

yes, please

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |