drm/msm/dsi: Improve dsi_phy_driver_probe() probe error handling
authorDouglas Anderson <dianders@chromium.org>
Thu, 4 Aug 2022 14:38:53 +0000 (07:38 -0700)
committerRob Clark <robdclark@chromium.org>
Sun, 18 Sep 2022 16:38:06 +0000 (09:38 -0700)
commitd175d6e0bb10e276cb074fb952cf859c37956567
tree8a1f5b35875f0c0d0265d728f2faf43ccdeb712f
parentd8810a66924482fc3977cebe3404629ad2647743
drm/msm/dsi: Improve dsi_phy_driver_probe() probe error handling

The dsi_phy_driver_probe() function has a "goto fail" for no
reason. Change it to just always return directly when it sees an
error. Make this simpler by leveraging dev_err_probe() which is
designed to make code like this shorter / simpler.

NOTE: as part of this, we now pass through error codes directly from
msm_ioremap_size() rather than translating to -ENOMEM. This changed
mostly because it's much more convenient when using dev_err_probe()
and also it's usually encouraged not to hide error codes like the old
code was doing unless there is a good reason. I can't see any reason
why we'd need to return -ENOMEM instead of -EINVAL from the probe
function.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/496324/
Link: https://lore.kernel.org/r/20220804073608.v4.6.I969118a35934a0e5007fe4f80e3e28e9c0b7602a@changeid
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c