diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2021-02-28 15:52:32 +0900 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2021-04-08 13:14:50 +0900 |
commit | fbf821ec632b4bb93ec9224c1e75c36b01ad16ed (patch) | |
tree | 201bead431aea7962e27c5aaeb1ea6d88025b565 /drivers/devfreq | |
parent | 62453f1ba5d5def9d58e140a50f3f168f028da38 (diff) | |
download | lwn-fbf821ec632b4bb93ec9224c1e75c36b01ad16ed.tar.gz lwn-fbf821ec632b4bb93ec9224c1e75c36b01ad16ed.zip |
PM / devfreq: rk3399_dmc: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/rk3399_dmc.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c index 9e9d3b4c6d48..293857ebfd75 100644 --- a/drivers/devfreq/rk3399_dmc.c +++ b/drivers/devfreq/rk3399_dmc.c @@ -324,22 +324,14 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev) mutex_init(&data->lock); data->vdd_center = devm_regulator_get(dev, "center"); - if (IS_ERR(data->vdd_center)) { - if (PTR_ERR(data->vdd_center) == -EPROBE_DEFER) - return -EPROBE_DEFER; - - dev_err(dev, "Cannot get the regulator \"center\"\n"); - return PTR_ERR(data->vdd_center); - } + if (IS_ERR(data->vdd_center)) + return dev_err_probe(dev, PTR_ERR(data->vdd_center), + "Cannot get the regulator \"center\"\n"); data->dmc_clk = devm_clk_get(dev, "dmc_clk"); - if (IS_ERR(data->dmc_clk)) { - if (PTR_ERR(data->dmc_clk) == -EPROBE_DEFER) - return -EPROBE_DEFER; - - dev_err(dev, "Cannot get the clk dmc_clk\n"); - return PTR_ERR(data->dmc_clk); - } + if (IS_ERR(data->dmc_clk)) + return dev_err_probe(dev, PTR_ERR(data->dmc_clk), + "Cannot get the clk dmc_clk\n"); data->edev = devfreq_event_get_edev_by_phandle(dev, "devfreq-events", 0); if (IS_ERR(data->edev)) |