Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp133800lqb; Tue, 4 Jun 2024 07:13:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtjJLPASjoS9iD5eXu8YLvkLcRfsukUikkfFtM1OOgvHfrk0qdXS8D4z1vHQxCouX87dOzYO95iwaOeom3wgoBmJo14bW3zcp2/I0IYQ== X-Google-Smtp-Source: AGHT+IGKVkKbnzYSE0GqRRvibefRJ1+pD1Lawfj3SnsTmlluKgptFHYO1WVnxBdTaIGnPsLsmYvB X-Received: by 2002:a05:6102:2413:b0:47c:122b:a3bd with SMTP id ada2fe7eead31-48bc1f6f30cmr11938940137.2.1717510383703; Tue, 04 Jun 2024 07:13:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717510383; cv=pass; d=google.com; s=arc-20160816; b=FNGlGtpdqnt1uBbO9mjeeRcfV7S5rUWQM/yGjKLvMqUAZnd2KyKHchXC/MIv96O6Nf ogpHQxoEcXX298AlSbWiwPVg5GArgEmQMLox1VTfycramcfMHJeYogTCKeG7VDkquACa L3duednIOIl9BNy40pxCcuFGPrruVkcjny62vP6GAPxOsEVxeShgpSke3sDHsjAcACKP 4+4TV87VTQQPDCspMCP7G3BXwkYUh7z4VdR+CAsB2lSOFMSxLxQUlI4aOk9WnpOs16Om DXqKzsNAlgQqUqCCYCHtcN/5OMEkIt/e8pGKcFR8Wrm+zPSHna/TVbd7xiou2EeWW7D1 mXRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QzY1hOL7nGil2Er/KjRqds3+/LQcNAkmpVr/bIInuZk=; fh=prwF+IS4+78DhODSQ8COjA5ACLZuXWsQfALigesEOUM=; b=0SAFlroYtSn2WWPYyujVRFz/+TpvclKbayoFKo2fJB9UW0dS51VJ2p/WffRsiJxU3/ WaLD5zZ1tvyyNXv1v8hysTEeHwTyXkz+wbkrcrc7Hs+tjtBXVSCmC4LjSkb9sxUMb36M cmbxLCvu+ysqrHOpE/5immWevi9qXhGUWx/Ioq/Pelk+E9VsHq9kud7KXmRfqLfbjZLg YfsYCprW01UPllRXLjhHPZr5AAiuB1UTgDSpV3R9HJvBBmwTJqB3eU7YD/GKKDWtvFdF 1VkXX7EOMbe9bZWYNl+DWfqzJb4onDvuirjjWCLUsaGzOXDIIwCoy/n8IL3OxS4sJTw4 BQsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pd1OgHOf; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-200785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48bbcfca764si1718113137.413.2024.06.04.07.13.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 07:13:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pd1OgHOf; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-200785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E7AE81C219AA for ; Tue, 4 Jun 2024 14:13:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADA9713790F; Tue, 4 Jun 2024 14:12:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pd1OgHOf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A526A134409; Tue, 4 Jun 2024 14:12:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717510340; cv=none; b=UDpmcvsbddak9Gn/32awk7JxTqqnNW+8IYNo3M4fhe++wTwHkhr9daI3jQYRVV0toAvuHCNRpwVphJPy4oIXQWe7xDmN2ntUzN3efmh04Sb6hGPnPQpQbMFK9KJ3DXJScyIYwmJ4yUJxpl9aI/0/US2fBEqvVVCV6ZysdauBGzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717510340; c=relaxed/simple; bh=a+dh7jhzlHhwln90offyZoiN+B1RFJofWEM3+SwHlVk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rTtR5yqnjCKNwYjpd0+0gu+1P4joD7L2YAP55Mk2+ehaptlJzNY7zdtdevVXNMZkRqscZa0/ANLXUlTKsWzZHniLZsW7wtCOQWFl9Woqg9jED/stHvPlTo99jkfMt0cLNunVN6GfaXYbdeRow4LrqbQqFrpW9nF7YnSUBB0PjEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pd1OgHOf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61F7BC32786; Tue, 4 Jun 2024 14:12:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717510340; bh=a+dh7jhzlHhwln90offyZoiN+B1RFJofWEM3+SwHlVk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pd1OgHOfoDM8EnggG7+pJFqnZGPBRXKf1p19Hkw8gIOj0vTIDFd8tqcqkmGwpKdyo tofQyVfh5WlIA/S31F61Z5naCXDj855GpWEYV+cYU7QcJnHh9hNoMCXgKsAsf0lmV1 AUb21ZBtGnjdRUE3Nyb6ltfmQ4lRiHCQxMQ8wVJo= Date: Tue, 4 Jun 2024 15:48:58 +0200 From: Greg Kroah-Hartman To: Stephen Boyd Cc: Michael Turquette , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, patches@lists.linux.dev, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, devicetree@vger.kernel.org, Brendan Higgins , David Gow , Rae Moar , "Rafael J . Wysocki" , Rob Herring , Saravana Kannan , Daniel Latypov , Christian Marangi , Krzysztof Kozlowski , Conor Dooley , Maxime Ripard Subject: Re: [PATCH v5 06/11] platform: Add test managed platform_device/driver APIs Message-ID: <2024060445-reverse-defendant-ec52@gregkh> References: <20240603223811.3815762-1-sboyd@kernel.org> <20240603223811.3815762-7-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240603223811.3815762-7-sboyd@kernel.org> On Mon, Jun 03, 2024 at 03:38:03PM -0700, Stephen Boyd wrote: > Introduce KUnit resource wrappers around platform_driver_register(), > platform_device_alloc(), and platform_device_add() so that test authors > can register platform drivers/devices from their tests and have the > drivers/devices automatically be unregistered when the test is done. > > This makes test setup code simpler when a platform driver or platform > device is needed. Add a few test cases at the same time to make sure the > APIs work as intended. > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Signed-off-by: Stephen Boyd > --- > Documentation/dev-tools/kunit/api/index.rst | 5 + > .../dev-tools/kunit/api/platformdevice.rst | 10 + > include/kunit/platform_device.h | 20 ++ > lib/kunit/Makefile | 4 +- > lib/kunit/platform-test.c | 223 +++++++++++++ > lib/kunit/platform.c | 302 ++++++++++++++++++ > 6 files changed, 563 insertions(+), 1 deletion(-) > create mode 100644 Documentation/dev-tools/kunit/api/platformdevice.rst > create mode 100644 include/kunit/platform_device.h > create mode 100644 lib/kunit/platform-test.c > create mode 100644 lib/kunit/platform.c Reviewed-by: Greg Kroah-Hartman