From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE36BC43219 for ; Thu, 27 Jan 2022 20:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343706AbiA0UCe (ORCPT ); Thu, 27 Jan 2022 15:02:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343624AbiA0UCO (ORCPT ); Thu, 27 Jan 2022 15:02:14 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C9DEC06174A for ; Thu, 27 Jan 2022 12:02:13 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id i186so1321525pfe.0 for ; Thu, 27 Jan 2022 12:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jvZVmrWmp26tHtV/xiUrxR2MIRDqBUgzND7wS5OXNzU=; b=Bu/x2wm+DigW2JkVo+zDM2QAK9Lh8Lzi7VQRjJWQQjpG5TztXs0H13hQM2D+/X1afo F/CZqb3T2TwiS2OBBiEi612vc8lapJ2aK7gIt8pyAQrdw+v+7we61eZhP/USER4FIKc2 BG1pnFxhjATM9z47bzqsrsQz0U2Se0uYrH80Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jvZVmrWmp26tHtV/xiUrxR2MIRDqBUgzND7wS5OXNzU=; b=i0MZUl8MqhCynYIcKhFNdTyEG0a9FT7s8+5gD0kD3+glI4fiIaCk3gBVRtUkUOA810 cFC4McB0zN9wH85sVCGjjlslx9ibMB37b3X5YStUF/RrZONTcrTqMLoxk+nljVGhAClE 31+KfUMy3/Eid7Kmiu4bJRjxaQqMl0N8Qn8EsDqnVHKI5FBGRUjNB1cSeGpHg5y0dol9 4BkSD7cTKe3UIGR5Vx8l3DdqlIdvr6gqGi+HodLkkDpywTYOpRqVRkXP6rU6fG3aRbat bopKiNi6rnKc6rLR6XQJERXnLoi/IWQTkW4d67TTJSOkbCJB33m0MyFphcObjmG9/cUx ejJQ== X-Gm-Message-State: AOAM531MZ1IhM/+gFGVAd6cnmCCbxkg4LKQp6TSoqxzxdgzoqOeZ5z83 6BM/hkV/1zEQJnTV3xrATEgIkw== X-Google-Smtp-Source: ABdhPJzgdo2xIvKWNBWJJ7FN2cYeL3DThlERus72aPFfW2Op1TpxXhf3bZPVZCrr2lRRpYJldojIjA== X-Received: by 2002:a63:fb4a:: with SMTP id w10mr3821171pgj.615.1643313732918; Thu, 27 Jan 2022 12:02:12 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:9246:1838:3243:3071]) by smtp.gmail.com with ESMTPSA id k21sm6561190pff.33.2022.01.27.12.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:02:12 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman , Douglas Anderson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Philipp Zabel , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v6 14/35] drm/imx: Migrate to aggregate driver Date: Thu, 27 Jan 2022 12:01:20 -0800 Message-Id: <20220127200141.1295328-15-swboyd@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220127200141.1295328-1-swboyd@chromium.org> References: <20220127200141.1295328-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use an aggregate driver instead of component ops so that we can get proper driver probe ordering of the aggregate device with respect to all the component devices that make up the aggregate device. Cc: Philipp Zabel Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/imx/imx-drm-core.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index cb685fe2039b..82645e42b7d3 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -196,8 +196,9 @@ static int compare_of(struct device *dev, void *data) return dev->of_node == np; } -static int imx_drm_bind(struct device *dev) +static int imx_drm_bind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct drm_device *drm; int ret; @@ -264,8 +265,9 @@ static int imx_drm_bind(struct device *dev) return ret; } -static void imx_drm_unbind(struct device *dev) +static void imx_drm_unbind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -279,14 +281,18 @@ static void imx_drm_unbind(struct device *dev) dev_set_drvdata(dev, NULL); } -static const struct component_master_ops imx_drm_ops = { - .bind = imx_drm_bind, - .unbind = imx_drm_unbind, +static struct aggregate_driver imx_drm_aggregate_driver = { + .probe = imx_drm_bind, + .remove = imx_drm_unbind, + .driver = { + .name = "imx_drm", + .owner = THIS_MODULE, + }, }; static int imx_drm_platform_probe(struct platform_device *pdev) { - int ret = drm_of_component_probe(&pdev->dev, compare_of, &imx_drm_ops); + int ret = drm_of_aggregate_probe(&pdev->dev, compare_of, &imx_drm_aggregate_driver); if (!ret) ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); @@ -296,7 +302,7 @@ static int imx_drm_platform_probe(struct platform_device *pdev) static int imx_drm_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &imx_drm_ops); + component_aggregate_unregister(&pdev->dev, &imx_drm_aggregate_driver); return 0; } -- https://chromeos.dev