power: reset: nvmem-reboot-mode: quiet some device deferrals
authorAndrew Halaney <ahalaney@redhat.com>
Thu, 17 Aug 2023 21:41:57 +0000 (16:41 -0500)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 12 Sep 2023 18:15:28 +0000 (20:15 +0200)
Some errors are being logged that are really due to deferrals,
which is confusing to users. Use dev_err_probe() to handle when to log
at error level versus debug. This also has the added bonuses of logging
to devices_deferred and printing the error value.

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Tested-by: Brian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20230817214218.638846-1-ahalaney@redhat.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/reset/nvmem-reboot-mode.c

index e229308d43e25c747eba3fbf3bcdb4c10fea2378..41530b70cfc48c2a83fbbd96f523d5816960a0d1 100644 (file)
@@ -45,8 +45,8 @@ static int nvmem_reboot_mode_probe(struct platform_device *pdev)
 
        nvmem_rbm->cell = devm_nvmem_cell_get(&pdev->dev, "reboot-mode");
        if (IS_ERR(nvmem_rbm->cell)) {
-               dev_err(&pdev->dev, "failed to get the nvmem cell reboot-mode\n");
-               return PTR_ERR(nvmem_rbm->cell);
+               return dev_err_probe(&pdev->dev, PTR_ERR(nvmem_rbm->cell),
+                                    "failed to get the nvmem cell reboot-mode\n");
        }
 
        ret = devm_reboot_mode_register(&pdev->dev, &nvmem_rbm->reboot);