Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15524045rwb; Mon, 28 Nov 2022 12:39:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CSXHKCSLBXHNNR1FCG4GT9punaLzngwLHVmF0KrAPFvRE24Zs0ohRXdJNJEiMtdWq+qLD X-Received: by 2002:a17:906:f756:b0:7bf:4a66:943f with SMTP id jp22-20020a170906f75600b007bf4a66943fmr6989598ejb.691.1669667971558; Mon, 28 Nov 2022 12:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669667971; cv=none; d=google.com; s=arc-20160816; b=O8u/Un3chz6wgNfYNX5HpPlNl7MntQ+kgfRUGAsSeEyv1QyY/wrNlkReYfJBv29qgs zyEg8EBb2+7flrikjl0fvY+kBxcaEI+BgJzQ7ImKuptbBUOi7xacaor4mnrfERriIyn2 jH0DFYS3+pmTry5JlEN6h1tadPdFyp6MtHtmPJsS8KQszV3Wl05wczE0w1vLIFqKzBCY vcncoIQnkTeSygN8mg5yawrJkPHPCNvp6gCu/iBDEE0/uMaCZPTIINuCekMQo/ZlvwkH /COgvYqpYe7xkz7bXR067yL3Y6a9hLlcMzHTcp5KoCvoJblbL6Vqrxa1MIYewkVkKYfi rgRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ISyLvvVbmkVMtysV5RC9fGrmHd3bXOuCgdRekBqVUuQ=; b=a16T54kIJf9m24Rt7JPT86outQbcI9BcScZvN9ij5ipIdWMLd3yNH7kMuqg0djRU4E H2vTlnxKKPBnKgR2rZ50TZSmRtLvSZt6lgtUbxx3N3UBnzKFc4UcA5sTcwie5B1IE4NH UP11B5qVPmygA7X4aoJPAbkrzM6FV4nIleB9QSsLHSMT8aiDJN/Cw401NNd8XyP7NAdJ FiMwQIk+dyrYqldhNZezuItAriRS9GXMG6WtsDG90XFCKDLf1jc8cmB6dj1O5zSN90NW aTfsCf7CvfPBrIDUEHvODiJOS12DdNdyyHWUqC7aeFYchMmGvzyz7ykT/H8jLD2IZ7BT 3ctA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=r5MQVKtb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020aa7d486000000b0046830a9c984si9581853edr.476.2022.11.28.12.39.11; Mon, 28 Nov 2022 12:39:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=r5MQVKtb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233920AbiK1UBx (ORCPT + 84 others); Mon, 28 Nov 2022 15:01:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233660AbiK1UBu (ORCPT ); Mon, 28 Nov 2022 15:01:50 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE4114026; Mon, 28 Nov 2022 12:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ISyLvvVbmkVMtysV5RC9fGrmHd3bXOuCgdRekBqVUuQ=; b=r5MQVKtbgyTmArJRqAObkt+Huo 1YLaklT6xQoWF0ibenjtpkC7v0/shWVftQ4U2j9KxQfx1ceIFcsD92/9qca5DgSzPz2tfXh/3D//N 9ybeK4Ho+l3GMPhmBdjiZchWvH4jDldxLYsrKVdG/QWnN9k4WXNBO1gvlQsl68CnRNuTTwXWcqdPY 3nCRN06alHSkHp21JSn+8/D87F4nIX5XTwkH8r4avvd2q5xyqARioU32lEGnTw1GJu8driWyTd3h8 9NsVQzszN422DMdRsEFlIHNRMuKmAJgvTrUaqp2tScNDAlGUruP6Cm5UySbQJq+kdDMoTH5rab6w8 d76yaa0w==; Received: from [177.34.169.227] (helo=[192.168.0.8]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1ozkJl-00Aboh-5u; Mon, 28 Nov 2022 21:01:29 +0100 Message-ID: <0ae37916-ecc1-d97c-6a98-c8008fdd05f6@igalia.com> Date: Mon, 28 Nov 2022 17:01:20 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v2 06/17] drm/tests: helpers: Switch to a platform_device Content-Language: en-US To: Maxime Ripard , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , David Airlie , Thomas Zimmermann Cc: David Gow , Greg Kroah-Hartman , Dave Stevenson , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Brendan Higgins , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org References: <20221123-rpi-kunit-tests-v2-0-efe5ed518b63@cerno.tech> <20221123-rpi-kunit-tests-v2-6-efe5ed518b63@cerno.tech> From: =?UTF-8?Q?Ma=c3=adra_Canal?= In-Reply-To: <20221123-rpi-kunit-tests-v2-6-efe5ed518b63@cerno.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/22 11:53, Maxime Ripard wrote: > The device managed resources are ran if the device has bus, which is not > the case of a root_device. > > Let's use a platform_device instead. > > Reviewed-by: Javier Martinez Canillas > Signed-off-by: Maxime Ripard Reviewed-by: Maíra Canal Best Regards, - Maíra Canal > --- > drivers/gpu/drm/tests/drm_kunit_helpers.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c > index 9fb045fa685f..15678ab823b0 100644 > --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c > +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c > @@ -7,6 +7,7 @@ > #include > > #include > +#include > > #define KUNIT_DEVICE_NAME "drm-kunit-mock-device" > > @@ -32,7 +33,16 @@ static const struct drm_mode_config_funcs drm_mode_config_funcs = { > */ > struct device *drm_kunit_helper_alloc_device(struct kunit *test) > { > - return root_device_register(KUNIT_DEVICE_NAME); > + struct platform_device *pdev; > + int ret; > + > + pdev = platform_device_alloc(KUNIT_DEVICE_NAME, PLATFORM_DEVID_NONE); > + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pdev); > + > + ret = platform_device_add(pdev); > + KUNIT_ASSERT_EQ(test, ret, 0); > + > + return &pdev->dev; > } > EXPORT_SYMBOL(drm_kunit_helper_alloc_device); > > @@ -45,7 +55,9 @@ EXPORT_SYMBOL(drm_kunit_helper_alloc_device); > */ > void drm_kunit_helper_free_device(struct kunit *test, struct device *dev) > { > - root_device_unregister(dev); > + struct platform_device *pdev = to_platform_device(dev); > + > + platform_device_unregister(pdev); > } > EXPORT_SYMBOL(drm_kunit_helper_free_device); > >