Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp590729yba; Thu, 18 Apr 2019 06:29:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/F58NzeTR2dwY3G7fQ4adiyiHOAkOPaU6wA32Qdq8iv8A3frJA8pFq4m/pp1/ukVI7K4b X-Received: by 2002:a05:6a00:c1:: with SMTP id e1mr89605900pfj.143.1555594166101; Thu, 18 Apr 2019 06:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555594166; cv=none; d=google.com; s=arc-20160816; b=M5y2Ge0m1B4dziXk/kFBOyfUDfzhg6auOtpzkb7hn/czjl7RkZfJ8/QxyQtjiipeuv bU9xvcdeeejNzIHRexdiH0b/XhAcvfZkNK7Jihks3ByrrJNcBiaXWSLvnr1GTmxTlIGu W2B8VfzMqr9mWEjoYpM5PDekF6j+zIFF3uUo4EJaNrg5MY8Z0LCnOpN6yhbRBF0ZvANL 3sxREBNm2Tn09Znd75WyowIHLG8VTQPlqPX29UHHPWpOlyuBvJJ8CN6UwYU2Rnq0jzpu udY8cXSG2M/QaP2CXf6Ty7bsBFNTyvrK3N9Z7RNiB75ASgyoEXuYHgmfKdDd4njTGDuB AE2A== 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=Lmu0JQ3X1TWi3PD7VQyIRIb/xEVKXGU05zrq/tXOQrw=; b=vR1YDcgLIaoFR+F1LZfWnHvZn4Dim83tq+gGfyvSSCikFPav91lQsZ0nQU/hervMXy O3qGQj5fRc1ne9SWEudWiRk1/jLE1WxSSmnqmrsBleZ29EdvDpLIm+AU7aNGEDoTUx1f Rg2An8KUq6I4IZRNdzD5crkMOqnnwX7jS26oa3AenSHRGqQZpnOcxF3JDsc34KNVO0X4 Lsd0Y2A9Rso7iAVwZRJOmesftmUklFhDiM4GqOT3jDBYdiWPTqfBOytAbE7mzNjVCPvI cfHxfXcFl+RVIf4d91ub1KL9vJU/cmFuG8y5Or8JM5qBVsye6cSGazQVvM+BLYzmBLyr l0oA== 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 a17si2049032plm.25.2019.04.18.06.29.11; Thu, 18 Apr 2019 06:29:26 -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 S2389105AbfDRN1v (ORCPT + 99 others); Thu, 18 Apr 2019 09:27:51 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:45939 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388263AbfDRN1v (ORCPT ); Thu, 18 Apr 2019 09:27:51 -0400 Received: from localhost.localdomain (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id EF49C200012; Thu, 18 Apr 2019 13:27:43 +0000 (UTC) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Cc: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Thomas Petazzoni , Paul Kocialkowski Subject: [PATCH 2/3] drm/sun4i: Set device driver data at bind time for use in unbind Date: Thu, 18 Apr 2019 15:27:26 +0200 Message-Id: <20190418132727.5128-3-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418132727.5128-1-paul.kocialkowski@bootlin.com> References: <20190418132727.5128-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our sun4i_drv_unbind gets the drm device using dev_get_drvdata. However, that driver data is never set in sun4i_drv_bind. Set it there to avoid getting a NULL pointer at unbind time. Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index ef38ea0a748d..af07291544a4 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -72,6 +72,8 @@ static int sun4i_drv_bind(struct device *dev) ret = -ENOMEM; goto free_drm; } + + dev_set_drvdata(dev, drm); drm->dev_private = drv; INIT_LIST_HEAD(&drv->frontend_list); INIT_LIST_HEAD(&drv->engine_list); -- 2.21.0