From patchwork Thu Aug 1 03:44:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 170304 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4836713ile; Wed, 31 Jul 2019 20:45:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyI2jXl4vf1Y0WjnFKsAdaQk4UA3AzYA54bke09L+Ty1xwEph+S/lyjwvnhYLeomYfUtGq X-Received: by 2002:a65:5cca:: with SMTP id b10mr119726429pgt.365.1564631129778; Wed, 31 Jul 2019 20:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564631129; cv=none; d=google.com; s=arc-20160816; b=vIEcraVIr43LiejF9qQnsJCtLstVh4IwEaicTqWxAzF2C9JI3dQLqF4L95ikydVYCI KRs/l2jDlSiJnLQBgpjS+TSan4wicIP4wdjKJaRwX1+GIpUzujeoMdiVYMcHwbsmABkY 3B/eIfMyO5HcCd3qIeAJs+orFIDtoOr6eVnha+wZbARWRbRl/BeiF6mcIXm7EqdON31k VHDAx0ehJ91mJxfex16tRxeEoOwcck2CqVfVU8Adpn1KZinAWTk2IYCcgzZ7fMdX4OFQ trUzXlIEW4fQjeXuvG2csz/v2Z0bF/p3VkYC/0R4b1qpsz/5ToVkB7vyPui9he7XVESq 6Eag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to; bh=HHcx+BxITb3HMq0O64rfrztTCSi4I7DVYy57GWZl2cQ=; b=WGOrzRrbVVdFBLu7LjqXZvzERDRHzsjisR6vo/G8hQ3yGRw/Gxg0hV+XJ28jT1h+Ef MRqVtRRiBrDOaoANfhMmfeijufBYoZ4HdWstBAx8U6cGziNj3baG8YqzEfzNfAQ7l9in n7m6D2A8vTI5PKvapM5e9n5Dy87xxfWLwOV/72WM2vvQ76XXtv5S0HV2YBwZ84ydGLnW shYa1iTqLHWt9ypnIn5IR4AkB2kNkrT8ue2R2x0SMGij2AZkBjHgBuuRAJefsiwMr3w8 GWu+ZAyitu3rqfz4uVNXXN5UZgkjq/xpEBUxBafGGvOf0byRIRkl6CY0Z8SXE/cZ82N0 4Ogg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id 138si33585506pfy.77.2019.07.31.20.45.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2019 20:45:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBAB56E354; Thu, 1 Aug 2019 03:45:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id D9B2A6E354 for ; Thu, 1 Aug 2019 03:45:20 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id n190so1833577pgn.0 for ; Wed, 31 Jul 2019 20:45:20 -0700 (PDT) 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=l0iGU7OjgEb+jEdW4ORscHtkcmdOvreVfILRvjj1+Oo=; b=TEnyUTatYHmHb2Vld1dDvKV0cPVf+RKuGouyacCpyuwG8DTCQGpIuUvamO0ZhsZLf9 sg6sPlhkONiaBb/Bi7oiAW5uO09wpki7aVdq9C47QKgoKmyw0VOpm2Rrqi8iRP6ZFV4k /ldvQGJAKJ0TRtTcoWSX3+oJFLDJPKed/po0lQZpLPgQtnD67HkYfRZ0f5tEbYMybgUO 37HoNHzOV5HpxmSiiDtdKsiKQ+t2a4CPKosaZlgTaZnzmOLagTbC7KueCRndXVJ7vFI4 8HvJkNLVJgD2tcbpVi+Ch/wy45NmyLu8Ib0kNpUAv2+FO1mIViEEzZ9hEG/1tRH2K3t9 7F3g== X-Gm-Message-State: APjAAAX6/dr9Puhmom6Iyr5OXQ8nnWAA6e0Re/Y81aCe/p+UIOMir+DW cw0QcAlyphFDKFUADoQfvs5uMw== X-Received: by 2002:a17:90a:32ec:: with SMTP id l99mr6319509pjb.44.1564631119659; Wed, 31 Jul 2019 20:45:19 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id h70sm64775674pgc.36.2019.07.31.20.45.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 20:45:18 -0700 (PDT) From: John Stultz To: lkml Subject: [PATCH v3 22/26] drm: kirin: Fix dev->driver_data setting Date: Thu, 1 Aug 2019 03:44:35 +0000 Message-Id: <20190801034439.98227-23-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190801034439.98227-1-john.stultz@linaro.org> References: <20190801034439.98227-1-john.stultz@linaro.org> X-Mailman-Original-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=l0iGU7OjgEb+jEdW4ORscHtkcmdOvreVfILRvjj1+Oo=; b=gzFKilZEeoz2ZWeGIlMCgbyjJirnk+SAY0OJ2oLnv6TDgPgy7gDOwYDgjgIFUQubIG 7+Y0HrHWaAB0e4dKi7eNz9DgY21doX491Hl5Sy+Sh8g5nK7pOWCIhguyG2hxQxlCJ3m+ V4lAkD5jZ1rxH+J1N3BMCfzf18dtcWa/tWf/bedn8Eoqbl0x//3hvJmPq5KY71XxHIb8 YdSwvhZxwjRcpluUmA+MymwndWUTD9T4yvsljP4JherbrCQlpvIfRr+p9hgxD0MBxlfi s3ziTT38BUOG0VrYrqLn0j3u59fVughR5SE25urd1EMxgHBxruMmZnuXjTImZQZ7Mj3O JUgw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xu YiPing , David Airlie , dri-devel , Rongrong Zou , Sam Ravnborg MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: David Airlie Cc: Daniel Vetter Cc: dri-devel Cc: Sam Ravnborg 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(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 0bdcac981d8b..09dc2c07533d 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 1c9658e9565e..f1853b84ab58 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -43,8 +43,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; @@ -139,6 +137,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)