Skip to content

Commit 754e0b5

Browse files
committed
drm/imx: imx-ldb: reduce scope of edid_len
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>
1 parent 23a6502 commit 754e0b5

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/gpu/drm/imx/imx-ldb.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ struct imx_ldb_channel {
6262
struct i2c_adapter *ddc;
6363
int chno;
6464
void *edid;
65-
int edid_len;
6665
struct drm_display_mode mode;
6766
int mode_valid;
6867
u32 bus_format;
@@ -536,15 +535,14 @@ static int imx_ldb_panel_ddc(struct device *dev,
536535
}
537536

538537
if (!channel->ddc) {
538+
int edid_len;
539+
539540
/* if no DDC available, fallback to hardcoded EDID */
540541
dev_dbg(dev, "no ddc available\n");
541542

542-
edidp = of_get_property(child, "edid",
543-
&channel->edid_len);
543+
edidp = of_get_property(child, "edid", &edid_len);
544544
if (edidp) {
545-
channel->edid = kmemdup(edidp,
546-
channel->edid_len,
547-
GFP_KERNEL);
545+
channel->edid = kmemdup(edidp, edid_len, GFP_KERNEL);
548546
} else if (!channel->panel) {
549547
/* fallback to display-timings node */
550548
ret = of_get_drm_display_mode(child,

0 commit comments

Comments
 (0)