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: 11070143 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FCCE13B1 for ; Thu, 1 Aug 2019 03:45:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31592283C3 for ; Thu, 1 Aug 2019 03:45:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25DC9283C8; Thu, 1 Aug 2019 03:45:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8193283C3 for ; Thu, 1 Aug 2019 03:45:29 +0000 (UTC) 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-Google-Smtp-Source: APXvYqwQrYrPD7WmSLedewQDsd/0ccueFsQ6lDrBBY/uwQkz1NbeQoHSUVHsVJakO64KiZOSs0/JsQ== 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" X-Virus-Scanned: ClamAV using ClamSMTP 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)