Skip to content

Commit

Permalink
drm: Use of_property_present() for non-boolean properties
Browse files Browse the repository at this point in the history
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241104190636.274926-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
robherring committed Jan 3, 2025
1 parent 0ab6ea2 commit 5d95e3c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/ite-it66121.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ static int it66121_audio_codec_init(struct it66121_ctx *ctx, struct device *dev)

dev_dbg(dev, "%s\n", __func__);

if (!of_property_read_bool(dev->of_node, "#sound-dai-cells")) {
if (!of_property_present(dev->of_node, "#sound-dai-cells")) {
dev_info(dev, "No \"#sound-dai-cells\", no audio\n");
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/sii902x.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
u8 lanes[4];
int num_lanes, i;

if (!of_property_read_bool(dev->of_node, "#sound-dai-cells")) {
if (!of_property_present(dev->of_node, "#sound-dai-cells")) {
dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
__func__);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ bool drm_is_panel_follower(struct device *dev)
* don't bother trying to parse it here. We just need to know if the
* property is there.
*/
return of_property_read_bool(dev->of_node, "panel");
return of_property_present(dev->of_node, "panel");
}
EXPORT_SYMBOL(drm_is_panel_follower);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/dsi/dsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
msm_dsi->te_source = devm_kstrdup(dev, te_source, GFP_KERNEL);
ret = 0;

if (of_property_read_bool(np, "syscon-sfpb")) {
if (of_property_present(np, "syscon-sfpb")) {
msm_host->sfpb = syscon_regmap_lookup_by_phandle(np,
"syscon-sfpb");
if (IS_ERR(msm_host->sfpb)) {
Expand Down

0 comments on commit 5d95e3c

Please sign in to comment.