From patchwork Tue Aug 20 23:06:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171879 Delivered-To: patches@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp180520ily; Tue, 20 Aug 2019 16:07:04 -0700 (PDT) X-Received: by 2002:a63:b64:: with SMTP id a36mr27332298pgl.215.1566342424202; Tue, 20 Aug 2019 16:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566342424; cv=none; d=google.com; s=arc-20160816; b=F8artvGXroeT84+1cOA5z3OnQFfB5GonpJjNT1lUx+OiJXyb9mVN6NS62MBd9gfNXy xriEmdxAZ7DGL86pH3FQeDbdBTu5Nlip9b9mG3uHUaaP+hiDdlcngGb/jwJONJ5XfLE9 Pg2Hjf5mpuYSi+icFhDY6Iv71fXIxoQpmbBp9COGDtompa7Z4WG/p3u22xlZZqUIkTm9 /mGSExvuTXfokHne7+SF3Gro86GUz8y/ObuvOvZEB/gVJcDO5eBF1XKzJRgB6V+R48cs 8tQ7XAdp6NMVZuyVH0cOT7FsTwPWNW0hfQeUYTqS9EDDh2Oq0Wuiwe2gyS771f6/75fc oVbA== 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=kPTZRFMdlMvsVJLbNqEMp+KDg1p/2/PzTgB54sSjI/U=; b=bSrMiEjW8iG5uRX6HaHSF8CJCW5BhU0QGM5CUTWUSHBKeth2TMQGhtqrfggFpq4C8m FrPoxGkolNTRV0+y6YWib1v8djtPyOVMAHIn+vBTLJdzR8YWtqjOBffCeAGhFFXOXcI9 S0oGDCeFVGmCLU17HrKPqIsu3SCW36RMaI5UgvGYz9JYhZEYlam837Cp1xoo8qZtFo8M ob9TEoSKoYHktLev4LAJsyz/asmnnAoMY3FH2MlDWIkuXekvF7u/hKD8KVQbGPCCUO9B mTVAwLQanmbGqkNwMT8mpflwo9s1jeI2k4tbKCxWdRXC3TIJozzUb+SXm3XZzo5qYZmv SMYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zyuDY+Dz; 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 f6sor5540820pfd.46.2019.08.20.16.07.04 for (Google Transport Security); Tue, 20 Aug 2019 16:07:04 -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=zyuDY+Dz; 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=kPTZRFMdlMvsVJLbNqEMp+KDg1p/2/PzTgB54sSjI/U=; b=zyuDY+Dz9GS/ATmdo/KHEQi19IecSLdC2e6bTsUgY8jsteM9oMqvfXbaXAc221LP31 yDMUOoUvjo/Bi9oOEz3JmkMbJIZIbvDJ9NOb6jy85smlKiLm+/XLeT245/yjrermAOY5 IJyQFysEf15/jxU+Cv4Idz8tX4x6CfhARclR4mJwN+/o4teAp1RCRWNuFLhU2HFq8L/t Lvdu//m4AfDM1ZNAvfH7KbtLSJKvmK/agBLsSJHP/82IzWM8RBUtf8i6T+OerKLYFRho R7ljI1474mWznSb+KYDK0/c9Y5HW1lvd6goCAFrlpf9zCKH0OPMwy5y9GB7i73I8Zk/g 9prQ== 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=kPTZRFMdlMvsVJLbNqEMp+KDg1p/2/PzTgB54sSjI/U=; b=UN2IrKlxX7K0tuPeA8gQ6HHueDUnI73lhpA0dACVcDvD+4beQHGRMwV34mPjSLYnVn x8NrZONGMS8Ag1JIk1XMp3bPdcUIV/ckMkjxkuZhXKLrQmM+D1Q8OI/1HBFhfihBJlwr EpXw1sodqRdw/2cioUBdPSrEUMOoUajw6mdnIkFUN5HLLst5a7OTIL0ABp9H6AfxQHUT KMHVK2CRvhMfB1RlFkbLAReFJHanjCiSHmYMifggpVR/OWbFUZ6/H7sHyHSl84RejCP+ ed63VjHrOeSU9cjrm7cbjSjSRkRE+hB98mB6forXMKKGifeC2DM+KuEqzyiU2fhXHLwC HP2g== X-Gm-Message-State: APjAAAUXr4OAAe7Mk1nyD14ToKBpy8EU+aOzwqgpveM9lM40FLf5BR2u oylejXpYqqBYnuUnpJN8+7giVtUk X-Google-Smtp-Source: APXvYqwPWi3hV1aULI47BdH1J86xCw7uOXUE660dq+vqeuPuIugq7A8By+kPCr/L6d0RdR//xPBKqQ== X-Received: by 2002:aa7:8488:: with SMTP id u8mr33269995pfn.229.1566342423834; Tue, 20 Aug 2019 16:07:03 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id q4sm27564747pff.183.2019.08.20.16.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 16:07:03 -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 v5 21/25] drm: kirin: Fix dev->driver_data setting Date: Tue, 20 Aug 2019 23:06:22 +0000 Message-Id: <20190820230626.23253-22-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190820230626.23253-1-john.stultz@linaro.org> References: <20190820230626.23253-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 e390b1b657b8..d8e40fcff386 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -999,7 +999,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 68de8838da3c..7f8d4539b1a9 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)