Message ID | 20230309152446.104913-1-m.szyprowski@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Neil Armstrong |
Headers | show |
Series | drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion again | expand |
On 09/03/2023 16:24, Marek Szyprowski wrote: > devm_regulator_get_enable_optional() returns -ENODEV if requested > optional regulator is not present. Adjust code for that, because in the > 67d0a30128c9 I've incorrectly assumed that it also returns 0 when > regulator is not present. > > Reported-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> > Fixes: 67d0a30128c9 ("drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion") > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > --- > drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c > index 534621a13a34..3d046878ce6c 100644 > --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c > +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c > @@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, > dw_plat_data = &meson_dw_hdmi->dw_plat_data; > > ret = devm_regulator_get_enable_optional(dev, "hdmi"); > - if (ret < 0) > + if (ret < 0 && ret != -ENODEV) > return ret; > > meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev, Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
On Thu, Mar 9, 2023 at 4:24 PM Marek Szyprowski <m.szyprowski@samsung.com> wrote: > > devm_regulator_get_enable_optional() returns -ENODEV if requested > optional regulator is not present. Adjust code for that, because in the > 67d0a30128c9 I've incorrectly assumed that it also returns 0 when > regulator is not present. > > Reported-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> > Fixes: 67d0a30128c9 ("drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion") > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
On 09/03/2023 16:24, Marek Szyprowski wrote: > devm_regulator_get_enable_optional() returns -ENODEV if requested > optional regulator is not present. Adjust code for that, because in the > 67d0a30128c9 I've incorrectly assumed that it also returns 0 when > regulator is not present. > > Reported-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> > Fixes: 67d0a30128c9 ("drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion") > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > --- > drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c > index 534621a13a34..3d046878ce6c 100644 > --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c > +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c > @@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, > dw_plat_data = &meson_dw_hdmi->dw_plat_data; > > ret = devm_regulator_get_enable_optional(dev, "hdmi"); > - if (ret < 0) > + if (ret < 0 && ret != -ENODEV) > return ret; > > meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev, I'll need to wait until v6.3-rc1 is backmerged into drm-misc-fixes to apply it. Thanks, Neil
Hi, On Thu, 09 Mar 2023 16:24:46 +0100, Marek Szyprowski wrote: > devm_regulator_get_enable_optional() returns -ENODEV if requested > optional regulator is not present. Adjust code for that, because in the > 67d0a30128c9 I've incorrectly assumed that it also returns 0 when > regulator is not present. > > Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes) [1/1] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion again https://cgit.freedesktop.org/drm/drm-misc/commit/?id=4028cbf867f70a3c599c9b0c9509334c56ed97d7
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index 534621a13a34..3d046878ce6c 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, dw_plat_data = &meson_dw_hdmi->dw_plat_data; ret = devm_regulator_get_enable_optional(dev, "hdmi"); - if (ret < 0) + if (ret < 0 && ret != -ENODEV) return ret; meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev,
devm_regulator_get_enable_optional() returns -ENODEV if requested optional regulator is not present. Adjust code for that, because in the 67d0a30128c9 I've incorrectly assumed that it also returns 0 when regulator is not present. Reported-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> Fixes: 67d0a30128c9 ("drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> --- drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)