mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 06:49:29 -04:00
spi: sg2044-nor: Convert to dev_err_probe()
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@linux.intel.com> Link: https://patch.msgid.link/20250313111423.322775-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
c6d9496333
commit
085cf53d71
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user