From patchwork Mon Aug 19 23:03:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171749 Delivered-To: patches@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3596240ily; Mon, 19 Aug 2019 16:03:58 -0700 (PDT) X-Received: by 2002:a17:902:830c:: with SMTP id bd12mr25503275plb.237.1566255837935; Mon, 19 Aug 2019 16:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566255837; cv=none; d=google.com; s=arc-20160816; b=GKsV7D0FeiEHPSb0dUXSUAeoRWCnRefNVd+I08PEFicBS7S2AUol7jWfpyUmxSCrqm Cvzh/ezwMRLNwKzJDri8+3Jf9z117FrBn6GvNw4pOzo/GioGm6QUL3nNNGDfLvpcPnFN /d+L74itFp2vog6sdOBkiH7Z2iyJUPCutzOsg6236oo3K76BbrvQzVZwdj2wx3HO/IAt sy39VLYw18pbpaGPmJuz9Js1hBGy4zcUjGPEQrACg7yTvdSx+QIK6hjdWDo3ut9F8N2q xaLRnTrtVVUIBz62ZwnYeAbhOtfzGkhgMM539BuZBj99uOyM54uNYwnhKdQbXFS22zZB I7Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KEp0elOXwEygi2UwLXppvJt7Q3Cx6Htjn7Pk6SXSqQ8=; b=pp5Ln5trbEmVX5FxYdffYyhKEsvvLKQ9Nw/OtWRmoqplpT48zVWdCyc+MDD8jdyhqs JxyplQ40ez9t4tiV58kvo7gPGIxHoNEGIp6p2yCrY07YsR9lYKpuK5ulCHWmHDy8CrIQ 8cAUMebjpXskwscAMVq2kQjettmdqKQYC9xnSL5IIgBgVlGDhNKr3Yn3A2i1AQUiavKy 5oaDJZ824UeIniqJ+2tUfSK7pPyq65tEXMdDJ9SJrWsTi6+pbzjIDZzaoKSxtwyXtN7D 2CxEg0Am7E8iIkHqJYWMRsofAKIxXVJWaSjkT2NvQWLFXgoBOYFE4KtekHcAGDDw4A3B TCNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pdOoZu3g; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k67sor2427756pje.16.2019.08.19.16.03.57 for (Google Transport Security); Mon, 19 Aug 2019 16:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pdOoZu3g; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KEp0elOXwEygi2UwLXppvJt7Q3Cx6Htjn7Pk6SXSqQ8=; b=pdOoZu3g7oZCCwI/bXh7Isj1qi7y7cuAYZjlN+hZ8RJndngrGKe3jT/YScIyRDgMNT pYPVudymwquCht5UccK02DFM0AWhxmeVDVk9bC7pe4gffL873wQNepON+skjV6CtE8H4 Jg6wdtOlhCm0vdb7MzFzOQehTSRG39gQQ2HOIoDeqjTWTtSr7zFMlcEs6IRu4fx7BV5Q Lq03F/OWNw/VyGswq7MnHya73oZtDsyq0wG/DccFS6mpab9sVNYoOxLb5pRaUtxvv1oc zON5zefzInYHEyMcWe3tYkxeRyKDep2/fRF21Sdmw4m/xzXqqt5c+2JIPXzMqxdukfGQ FUoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KEp0elOXwEygi2UwLXppvJt7Q3Cx6Htjn7Pk6SXSqQ8=; b=tKftpc/KwFMTA3nMni85RFspbgu2OmsB8CBOenawRcP0dFm1xUAN879Nn3K03yvpD8 JYv9HgwMDbkYFCJN0/uHsOabGpapdxLjIog3tFe/XJipzfizDjW71FhfTXvoIQ0dj4I4 DA3gjWP0RCk4MGfCk35crFxOSPnQqziQKkBcGikP1DvSVv2DdMrrnevlbtbbAMuII/0d +3eVKDM5G2CtZIyO0VnMQSch8eUa6gCVO3zE+kUhaeacbc1IxCCj+phZ+9ySafeaAiMD ug+sqpXYGUhvMTA7ZWNOUWwENtn/G40tdC4Y5YgIInNjQj8mSezG6jY/7ZrZglqjnowN 8Drg== X-Gm-Message-State: APjAAAXdGN6WH023AuAHxihRePxfZdpi9MJv6fE2U/+MyKlIlY2pZlK4 e7BgnKZdApwmE8nJCOQk2hWCHEmc X-Google-Smtp-Source: APXvYqzy7dL1PlN9gj3IYtPQmc4I8figOnswPtwMOyqf8D1q6BzRiYl/2/7Jcm3uza9avL8EUpXNcA== X-Received: by 2002:a17:90a:246f:: with SMTP id h102mr22983749pje.125.1566255837541; Mon, 19 Aug 2019 16:03:57 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id j15sm17256509pfr.146.2019.08.19.16.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 16:03:56 -0700 (PDT) From: John Stultz To: lkml Cc: Xu YiPing , Rongrong Zou , Xinliang Liu , David Airlie , Daniel Vetter , dri-devel , Sam Ravnborg , John Stultz Subject: [PATCH v4 21/25] drm: kirin: Fix dev->driver_data setting Date: Mon, 19 Aug 2019 23:03:17 +0000 Message-Id: <20190819230321.56480-22-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819230321.56480-1-john.stultz@linaro.org> References: <20190819230321.56480-1-john.stultz@linaro.org> From: Xu YiPing As part of refactoring the kirin driver to better support different hardware revisions, this patch changes the dev->driver_data to point to a drm_device, not ade_data. Thus we set the driver data to drm device after alloc. Cc: Rongrong Zou Cc: Xinliang Liu Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel Cc: Sam Ravnborg Acked-by: Xinliang Liu Reviewed-by: Sam Ravnborg Signed-off-by: Xu YiPing [jstultz: Reworded commit message] Signed-off-by: John Stultz --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index a0cc1285512b..a7fe2fc57bf7 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -998,7 +998,6 @@ static int ade_drm_init(struct platform_device *pdev) DRM_ERROR("failed to alloc ade_data\n"); return -ENOMEM; } - platform_set_drvdata(pdev, ade); ctx = ade_hw_ctx_alloc(pdev, &ade->crtc.base); if (IS_ERR(ctx)) { diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index f92b3f7de5c0..55c8dbb68be0 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -44,8 +44,6 @@ static int kirin_drm_kms_init(struct drm_device *dev) { int ret; - dev_set_drvdata(dev->dev, dev); - /* dev->mode_config initialization */ drm_mode_config_init(dev); dev->mode_config.min_width = 0; @@ -140,6 +138,7 @@ static int kirin_drm_bind(struct device *dev) drm_dev = drm_dev_alloc(driver_data->driver, dev); if (IS_ERR(drm_dev)) return PTR_ERR(drm_dev); + dev_set_drvdata(dev, drm_dev); ret = kirin_drm_kms_init(drm_dev); if (ret)