Skip to contentSkip to conversation

spi: bcm2835: don't print error on clk_get() DEFER

PATCH In review Jim Quinlan 4 participants 6 messages Dec 12, 2019 – Dec 16, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: bcm2835: don't print error on clk_get() DEFER

Otherwise one may get multiple error messages for normal operation of a clock provider.

---
 drivers/spi/spi-bcm2835.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-bcm2835.c +2 -1
index fb61a620effc..6c9addc9f276 100644
@@ -1305,7 +1305,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 	bs->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(bs->clk)) {
 		err = PTR_ERR(bs->clk);
-		dev_err(&pdev->dev, "could not get clk: %d\n", err);
+		if (err != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "could not get clk: %d\n", err);
 		goto out_controller_put;
 	}
 
Signature · 1 line
2.17.1
maintainer
#3 lore raw
In reply to Jim Quinlan

drivers/spi/spi-bcm2835.c static int bcm2835_spi_probe(struct platform_device *pdev) · line 1309

Quoted 8 lines · Jim Quinlan

Otherwise one may get multiple error messages for normal operation of a clock provider.

drivers/spi/spi-bcm2835.c +2 -1
 	if (IS_ERR(bs->clk)) {
 		err = PTR_ERR(bs->clk);
-		dev_err(&pdev->dev, "could not get clk: %d\n", err);
+		if (err != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "could not get clk: %d\n", err);

On the other hand if the clock isn't there and never appears then there won't be anything saying why the driver isn't loading which won't be helpful when trying to figure out what's going on.

#4 lore raw
Quoted 11 lines · Mark Brown

drivers/spi/spi-bcm2835.c static int bcm2835_spi_probe(struct platform_device *pdev) · line 1309

Quoted 8 lines · Jim Quinlan

Otherwise one may get multiple error messages for normal operation of a clock provider.

      if (IS_ERR(bs->clk)) {
              err = PTR_ERR(bs->clk);
drivers/spi/spi-bcm2835.c +2 -1
-             dev_err(&pdev->dev, "could not get clk: %d\n", err);
+             if (err != -EPROBE_DEFER)
+                     dev_err(&pdev->dev, "could not get clk: %d\n", err);
Quoted 3 lines

On the other hand if the clock isn't there and never appears then there won't be anything saying why the driver isn't loading which won't be helpful when trying to figure out what's going on.

Understood; I could do a dev_dbg() on -EPROBE_DEFER and dev_err() on all other errors -- would that work for you?

maintainer
#5 lore raw
Quoted 2 lines · Jim Quinlan

Understood; I could do a dev_dbg() on -EPROBE_DEFER and dev_err() on all other errors -- would that work for you?

Yes, that sounds good.