Skip to content

Commit

Permalink
drm/imx: imx-ldb: reduce scope of edid_len
Browse files Browse the repository at this point in the history
The edid_len variable is never used again. Use a local variable instead
of storing it in the device structure.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Philipp Zabel committed Oct 27, 2020
1 parent 23a6502 commit 754e0b5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/gpu/drm/imx/imx-ldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ struct imx_ldb_channel {
struct i2c_adapter *ddc;
int chno;
void *edid;
int edid_len;
struct drm_display_mode mode;
int mode_valid;
u32 bus_format;
Expand Down Expand Up @@ -536,15 +535,14 @@ static int imx_ldb_panel_ddc(struct device *dev,
}

if (!channel->ddc) {
int edid_len;

/* if no DDC available, fallback to hardcoded EDID */
dev_dbg(dev, "no ddc available\n");

edidp = of_get_property(child, "edid",
&channel->edid_len);
edidp = of_get_property(child, "edid", &edid_len);
if (edidp) {
channel->edid = kmemdup(edidp,
channel->edid_len,
GFP_KERNEL);
channel->edid = kmemdup(edidp, edid_len, GFP_KERNEL);
} else if (!channel->panel) {
/* fallback to display-timings node */
ret = of_get_drm_display_mode(child,
Expand Down

0 comments on commit 754e0b5

Please sign in to comment.