Skip to content

Commit d78be40

Browse files
Yang Yingliangvireshk
authored andcommitted
cpufreq: qcom-nvmem: Switch to use dev_err_probe() helper
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent ab4fdc7 commit d78be40

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/cpufreq/qcom-cpufreq-nvmem.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
299299
if (drv->data->get_version) {
300300
speedbin_nvmem = of_nvmem_cell_get(np, NULL);
301301
if (IS_ERR(speedbin_nvmem)) {
302-
if (PTR_ERR(speedbin_nvmem) != -EPROBE_DEFER)
303-
dev_err(cpu_dev,
304-
"Could not get nvmem cell: %ld\n",
305-
PTR_ERR(speedbin_nvmem));
306-
ret = PTR_ERR(speedbin_nvmem);
302+
ret = dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem),
303+
"Could not get nvmem cell\n");
307304
goto free_drv;
308305
}
309306

0 commit comments

Comments
 (0)