Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1322910yba; Tue, 2 Apr 2019 06:52:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYXjlU4p7BJ3xOUD24E1HZIfrRYdC/fjf85ZL0ywIRBLqG4kZphWHhEd5YypPziwX4CFyb X-Received: by 2002:a17:902:8ecc:: with SMTP id x12mr58549617plo.0.1554213141073; Tue, 02 Apr 2019 06:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554213141; cv=none; d=google.com; s=arc-20160816; b=DQdwCVHHXtV4cnACevfBut6svnutLRKwCtBc3y74Cn3UX0EoFBhpqt0wRgj6Z8UdaO AN6zh0INcWExE+/3PTWv+Omg4aPaGTwhOO+Oe+AZXXknJU0tM49XTvK6eUnHw8Wqy8cp Mi17IYK6dQ8OYU15P31MJ0z0l13vt/g3gZnHmSEG6B5Nl63H9nTpHLY/II/wWMyqtewb y0ti7bTdGS/xt2rmqfRF3nBpmNSKdytCmSoFXCNg9SHkdbrGXzTu6zXLQa01RFzIeUKP AFR47jTdtsmUIuiTdi5rlo1EzpaQ3Vw3ceTAFv+0l/HphJyjmryg/PTef5mVUxc4kZBW bjNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gOJqQDhq/nS4styJbZdxJwyMK//UO9T3grilOKyzD+4=; b=mQmNscl8sfY4W9AIWCK7XrpH9VzSpYnM9DFvLfftIF96m/dX2yNpKVTSE13zZJAOm9 RdtbiC3ABFx9yQSDV+DRO5cSpdaDBMBtbL6mJz5jgX+LjDaGgYTIcFVkonhS047h+KCU w9Nh95hirZ8rdl5ZT0PpNqLnRVO+XN9V1zpR5tZh3HFnhtxqf/H0VDXfLEqLORwdwBJn S4xms6O2VB81rmQnxmwHLbaL+dNsnetDuYcT3XKAWKMNWGqwxuP+i+BP+UiAFN0NB3K8 SdXAtKvuS4/Al/tq0gpnL2ak1Fo/+wsR5MkOcu/4cHpdjuh0wZ5WgZ1qh2Sn5U+IVKhi LHhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l32si11177121pgm.130.2019.04.02.06.52.05; Tue, 02 Apr 2019 06:52:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732253AbfDBNth (ORCPT + 99 others); Tue, 2 Apr 2019 09:49:37 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:47951 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbfDBNtf (ORCPT ); Tue, 2 Apr 2019 09:49:35 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBJmn-0007VQ-Js; Tue, 02 Apr 2019 15:49:09 +0200 Received: from mgr by dude.hi.pengutronix.de with local (Exim 4.92-RC6) (envelope-from ) id 1hBJmm-0001Dn-QZ; Tue, 02 Apr 2019 15:49:08 +0200 From: Michael Grzeschik To: p.zabel@pengutronix.de, airlied@linux.ie, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux@armlinux.org.uk, dri-devel@lists.freedesktop.org, rafael@kernel.org, kernel@pengutronix.de Subject: [PATCH 2/3] ipuv3-ldb: add init list head on bind Date: Tue, 2 Apr 2019 15:49:03 +0200 Message-Id: <20190402134904.588-3-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190402134904.588-1-m.grzeschik@pengutronix.de> References: <0687f68004b28ed3a364b06a9eb64e2e@agner.ch> <20190402134904.588-1-m.grzeschik@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mgr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The list head is not initialised after imx_ldb_bind allocates the imx_ldb object. Ensure it will be valid before anyone uses it. Signed-off-by: Michael Grzeschik --- drivers/gpu/drm/imx/imx-ldb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 3837333022804..a11f8758da70e 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -581,6 +581,20 @@ static int imx_ldb_panel_ddc(struct device *dev, return 0; } +static void ipu_ldb_init_encoder_head(struct imx_ldb *imx_ldb) +{ + struct imx_ldb_channel *imx_ldb_ch; + struct drm_encoder *encoder; + + imx_ldb_ch = &imx_ldb->channel[0]; + encoder = &imx_ldb_ch->encoder; + INIT_LIST_HEAD(&encoder->head); + + imx_ldb_ch = &imx_ldb->channel[1]; + encoder = &imx_ldb_ch->encoder; + INIT_LIST_HEAD(&encoder->head); +} + static int imx_ldb_bind(struct device *dev, struct device *master, void *data) { struct drm_device *drm = data; @@ -597,6 +611,8 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data) if (!imx_ldb) return -ENOMEM; + ipu_ldb_init_encoder_head(imx_ldb); + imx_ldb->regmap = syscon_regmap_lookup_by_phandle(np, "gpr"); if (IS_ERR(imx_ldb->regmap)) { dev_err(dev, "failed to get parent regmap\n"); -- 2.20.1