Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp757750pxb; Fri, 28 Jan 2022 09:18:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJySra94cAlnfSgcEkMWOfPxhkStbPw8m3nlKYNqQ+sbjMr5iWdO2YcRWxTuoojBtLOKQfM6 X-Received: by 2002:a05:6a00:852:: with SMTP id q18mr8974264pfk.74.1643390338271; Fri, 28 Jan 2022 09:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643390338; cv=none; d=google.com; s=arc-20160816; b=HfQHKX0ahAKbKHY/JzeupXsH8enYlGn9ShoYGl2tnxg7JTRChVNNshpHCm7Y83CjnE t3L5WUuE+zuxgcIl0MaOlVHkhFGVCauhypCIdS/vl93fJeY6DtFPnmmF6bd4EhiyeSas SDNkEIr3Etbb/naRqHw4GxnUtrdMgzNRPDojKEaVGYSNNpB5Wx8+iCfchxOjN5arxi23 FpAPpw5NLzDf8qKDvnIfMwrp4zmdfXzY0ChfrvMjCsESAbbiaXJoA6OTT36lPdmmsww2 945ViLgksZL/EaQcbH7dpZvDzo8hhXOyykucTnSQMLubBt3A1makP27v768lnmQ8curk SPJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jvZVmrWmp26tHtV/xiUrxR2MIRDqBUgzND7wS5OXNzU=; b=mNc1thwSaxVvqx7IL9A+dsWpxq6Me4bJ6/gnkXcMCs7zTqR48kma1gaBnUMuGLzLwl Ll1ibc9Xw3oy+OOy7WkHrSBIhzlcVVAPhMO6nFnFuKU2/viR2irfpLGtzGc5zu2z2lke tfcamx2NAV1ZM7alw2RU1usLscPu3V9rRpZF8HeAcTEzNHPb5J9K0JE7RP7b4tUC6e1p bGewbfBFr8K0pq7Lva2G+x26+nkt3h5BFpHzTKg6nUqKXxU1TtFCxurqXP9PysrJGoxC 4y4bM6r2V6+EMNU/JAwQKoWv3C32cWB+s/ISK/5vDHpM/wLUuYepZfTEhth3hb4hhjkt C7Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Bu/x2wm+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si3048185pjn.99.2022.01.28.09.18.45; Fri, 28 Jan 2022 09:18:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Bu/x2wm+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343690AbiA0UCd (ORCPT + 99 others); Thu, 27 Jan 2022 15:02:33 -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-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