One of the cases in sg2044_spifmc_probe() may be converted to use dev_err_probe(). Do it. While at it, use local device pointer in all such calls and drop unneeded __func__ parameter as dev_err_probe() is assumed to be called only during probe phase. Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> --- drivers/spi/spi-sg2044-nor.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-sg2044-nor.c b/drivers/spi/spi-sg2044-nor.c index 95822f2fc521..d3582c84538e 100644 --- a/drivers/spi/spi-sg2044-nor.c +++ b/drivers/spi/spi-sg2044-nor.c @@ -439,9 +439,7 @@ static int sg2044_spifmc_probe(struct platform_device *pdev) spifmc->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(spifmc->clk)) - return dev_err_probe(&pdev->dev, PTR_ERR(spifmc->clk), - "%s: Cannot get and enable AHB clock\n", - __func__); + return dev_err_probe(dev, PTR_ERR(spifmc->clk), "Cannot get and enable AHB clock\n"); spifmc->dev = &pdev->dev; spifmc->ctrl = ctrl; @@ -465,10 +463,8 @@ static int sg2044_spifmc_probe(struct platform_device *pdev) sg2044_spifmc_init_reg(spifmc); ret = devm_spi_register_controller(&pdev->dev, ctrl); - if (ret) { - dev_err(&pdev->dev, "spi_register_controller failed\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "spi_register_controller failed\n"); return 0; } -- 2.47.2