Message ID | 20250409131318.108690-24-angelogioacchino.delregno@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add support for MT8195/88 HDMIv2 and DDCv2 | expand |
Hi, Angelo: On Wed, 2025-04-09 at 15:13 +0200, AngeloGioacchino Del Regno wrote: > External email : Please do not click links or open attachments until you have verified the sender or the content. > > > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over > syscon_regmap_lookup_by_phandle() combined with getting the syscon > argument. Except simpler code this annotates within one line that given > phandle has arguments, so grepping for code would be easier. > > There is also no real benefit in printing errors on missing syscon > argument, because this is done just too late: runtime check on > static/build-time data. Dtschema and Devicetree bindings offer the > static/build-time check for this already. Please rebase this patch to the first patch of this series. I would like to apply refinement patch first then apply hdmi v2 patches. Regards, CK > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > [Angelo: Rebased over HDMIv2/DDCv2 series cleanups] > Reviewed-by: CK Hu <ck.hu@mediatek.com> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- > drivers/gpu/drm/mediatek/mtk_hdmi_common.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c > index 784bc05c9541..00a638a3caf4 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c > @@ -269,12 +269,9 @@ static int mtk_hdmi_get_cec_dev(struct mtk_hdmi *hdmi, struct device *dev, struc > * MMSYS_CONFIG device and the register offset of the HDMI_SYS_CFG > * registers it contains. > */ > - hdmi->sys_regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi"); > + hdmi->sys_regmap = syscon_regmap_lookup_by_phandle_args(np, "mediatek,syscon-hdmi", > + 1, &hdmi->sys_offset); > if (IS_ERR(hdmi->sys_regmap)) > - return PTR_ERR(hdmi->sys_regmap); > - > - ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1, &hdmi->sys_offset); > - if (ret) > return dev_err_probe(dev, ret, > "Failed to get system configuration registers\n"); > > -- > 2.49.0 >
Il 15/04/25 10:14, CK Hu (胡俊光) ha scritto: > Hi, Angelo: > > On Wed, 2025-04-09 at 15:13 +0200, AngeloGioacchino Del Regno wrote: >> External email : Please do not click links or open attachments until you have verified the sender or the content. >> >> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> >> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over >> syscon_regmap_lookup_by_phandle() combined with getting the syscon >> argument. Except simpler code this annotates within one line that given >> phandle has arguments, so grepping for code would be easier. >> >> There is also no real benefit in printing errors on missing syscon >> argument, because this is done just too late: runtime check on >> static/build-time data. Dtschema and Devicetree bindings offer the >> static/build-time check for this already. > > Please rebase this patch to the first patch of this series. > I would like to apply refinement patch first then apply hdmi v2 patches. > Please use the original patch if it still applies, then: 20250112134708.46100-1-krzysztof.kozlowski@linaro.org Cheers, Angelo > Regards, > CK > >> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> [Angelo: Rebased over HDMIv2/DDCv2 series cleanups] >> Reviewed-by: CK Hu <ck.hu@mediatek.com> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> >> --- >> drivers/gpu/drm/mediatek/mtk_hdmi_common.c | 7 ++----- >> 1 file changed, 2 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c >> index 784bc05c9541..00a638a3caf4 100644 >> --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c >> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c >> @@ -269,12 +269,9 @@ static int mtk_hdmi_get_cec_dev(struct mtk_hdmi *hdmi, struct device *dev, struc >> * MMSYS_CONFIG device and the register offset of the HDMI_SYS_CFG >> * registers it contains. >> */ >> - hdmi->sys_regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi"); >> + hdmi->sys_regmap = syscon_regmap_lookup_by_phandle_args(np, "mediatek,syscon-hdmi", >> + 1, &hdmi->sys_offset); >> if (IS_ERR(hdmi->sys_regmap)) >> - return PTR_ERR(hdmi->sys_regmap); >> - >> - ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1, &hdmi->sys_offset); >> - if (ret) >> return dev_err_probe(dev, ret, >> "Failed to get system configuration registers\n"); >> >> -- >> 2.49.0 >> >
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c index 784bc05c9541..00a638a3caf4 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c @@ -269,12 +269,9 @@ static int mtk_hdmi_get_cec_dev(struct mtk_hdmi *hdmi, struct device *dev, struc * MMSYS_CONFIG device and the register offset of the HDMI_SYS_CFG * registers it contains. */ - hdmi->sys_regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi"); + hdmi->sys_regmap = syscon_regmap_lookup_by_phandle_args(np, "mediatek,syscon-hdmi", + 1, &hdmi->sys_offset); if (IS_ERR(hdmi->sys_regmap)) - return PTR_ERR(hdmi->sys_regmap); - - ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1, &hdmi->sys_offset); - if (ret) return dev_err_probe(dev, ret, "Failed to get system configuration registers\n");