From patchwork Tue Apr 23 23:20:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162758 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4354955jan; Tue, 23 Apr 2019 16:21:30 -0700 (PDT) X-Received: by 2002:a17:902:44c:: with SMTP id 70mr18245455ple.31.1556061690697; Tue, 23 Apr 2019 16:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556061690; cv=none; d=google.com; s=arc-20160816; b=rBWLwcJoyuGn+DggOXfsl06fcqP/lF2mB6R1QrM3vsGqKKGgGuQ8Hi0eHBkzmzXklb HNTloAIwUiC/8NzZ/LwuYd8g7s4z4BssfYmnCrx00/fzG9yaYeJfbClpMCQJAeZZ8QvZ 9AUgljdTHnVA9mRCXl0jUDx1+SBAXkl1o2NYhhpfJ1zzkVrBeL+gdjZe+11AWW/FgCHS jkNSCcr9kxVJehbHXd4mkNu6r/VqDcafwa0mBwPZEQVnuxz7/QkthPk/3q8TLBLEamnK I4aZG6/vt1eMWlluYYcuVSlrZjQYRKPWsYM+R0Hvh2wCDcV+l/XzGykSBkqmBdTyF3O0 jNAg== 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=VZpIv+9XMJ9csXRza8KzL21yNgQLvZSyCbypyWHMOUw=; b=nOpYLG9IayZ8Nxf9XBKmt2O1UcNzz5x+CVlgfIzGKV11COuTHnHBUc3fejmWh385jQ /Fb1qjdx7xtoy8b5afssR5iPgxwMrOGtMEdb7MtoIFrVAwF+gtOGvxwUdTC6hemkzhS2 bsPCFsR4BUjTA4O5Z6MYOHtmOfqH8Wq7RC9S3XHgtXogfCISd2Dj1R3XNfHGNUccOhnr b60BgCr/sYwOVmEHqxj/vetsm0N1oLSfQnm1SkpUlK4t9RHsZxg8SnUA0/l+EOp8DKNM u/DL+Ff3/VaxdVv7lcqJa6RF+acyMgU+Ga7IvYpdvSiiSEl3Eimv/2pmIbm7fdTw4pJd SqFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zRR/Qo5b"; 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 s144sor3989219pfc.42.2019.04.23.16.21.30 for (Google Transport Security); Tue, 23 Apr 2019 16:21:30 -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="zRR/Qo5b"; 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=VZpIv+9XMJ9csXRza8KzL21yNgQLvZSyCbypyWHMOUw=; b=zRR/Qo5bYroXdXojCw8cu739K44KjE9a9FCvieFsAEgn4wA0iSXY4E8KlxyzBr8AIJ fCkc8zhwYkRj0wRJW8zO36ltNNXsH9tcC21c6owPLKQFGSkZKulPoh1WRMhBRS/eWtFn sOI6NTCzAIp6hHrRq3P/3wGZzWanOAdARjN/4k+fg1urddAfw2v+hVRXIBLFTpucRKrg x1WRMiNoLMX84V+RXhiMXCtAMAKYzjh3ZxijaOz8noszCMRJOy8Q9dF5XDGmI6LLfgsr skSZfAHFC6wCQaOKfFo1S4g6IgobfFVbt+SVllr/v31fxbi9yDQMkvOd48y+mZuilEP5 hy+A== 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=VZpIv+9XMJ9csXRza8KzL21yNgQLvZSyCbypyWHMOUw=; b=Bqwkalmg9FTAgmHGvM2cmEL5PTMoIJmazE43N61wMSmnfeCE79g/tENhAQa0cbw9/8 4vO/MLem/Rked0yul1fQXvHO3U7Esb1J3pC9u6Rsmdva15xq2YsjpKRxYYR7oDqt/aBl QAO0EsBTulH7pczII7i0q89Snola4myjmWHIh+QiEAxEeXAcwI7hfOrpb9XQGBQxf/lf XyZuJ2UbDVYutdQE2DpRTNkQwNtCiQ1543iSgU3CrflbdFE7D2LtETp7lMRTl3X8NQky oSo8H5wuubN4jZj0IiHEDv7fmESOnscWNy5BN5mFLVWyfxpbgQ3TH33DAsYnGBbwgpmL fhXA== X-Gm-Message-State: APjAAAX/8FyIcPcdZFwHNgbI9UNNAyrlbEHACwvBtqabcg72ePQZJZoe +3mfbu55JGG4Z57s7OCp2tMTR2JNzjXJAQ== X-Google-Smtp-Source: APXvYqz9MfY/qTz0PFUH+681l2VpDr/fJck5yp7tggLJ7C4wLYYD1x3aIj8pRAQAd8EMBRUTP09Qdg== X-Received: by 2002:aa7:8458:: with SMTP id r24mr10796538pfn.231.1556061690322; Tue, 23 Apr 2019 16:21:30 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id c28sm6984235pgm.42.2019.04.23.16.21.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Apr 2019 16:21:29 -0700 (PDT) From: John Stultz To: lkml Cc: Xu YiPing , Xinliang Liu , Rongrong Zou , Xinwei Kong , Chen Feng , David Airlie , Daniel Vetter , dri-devel , John Stultz Subject: [PATCH 21/25] drm: kirin: Fix dev->driver_data setting Date: Tue, 23 Apr 2019 16:20:52 -0700 Message-Id: <1556061656-1733-22-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556061656-1733-1-git-send-email-john.stultz@linaro.org> References: <1556061656-1733-1-git-send-email-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: Xinliang Liu Cc: Rongrong Zou Cc: Xinwei Kong Cc: Chen Feng Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel 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.7.4 diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 21965ee..3d5bd3a 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 5ee90d7..a2938d4 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -45,8 +45,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; @@ -141,6 +139,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)