[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZB6UfBMtntqrLlKz@kroah.com>
Date: Sat, 25 Mar 2023 07:28:12 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: David Gow <davidgow@...gle.com>
Cc: Matti Vaittinen <mazziesaccount@...il.com>,
Maxime Ripard <maxime@...no.tech>,
Brendan Higgins <brendan.higgins@...ux.dev>,
Stephen Boyd <sboyd@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Jonathan Cameron <jic23@...nel.org>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com
Subject: Re: [RFC PATCH 2/2] kunit: Add APIs for managing devices
On Sat, Mar 25, 2023 at 12:31:04PM +0800, David Gow wrote:
> Tests for drivers often require a struct device to pass to other
> functions. While it's possible to create these with
> root_device_register(), or to use something like a platform device, this
> is both a misuse of those APIs, and can be difficult to clean up after,
> for example, a failed assertion.
>
> Add two KUnit-specific functions for registering and unregistering a
> struct device:
> - kunit_device_register()
> - kunit_device_unregister()
>
> These behave similarly to root_device_register() and
> root_device_unregister() except:
> - They take a struct kunit pointer with a test context.
> - They do not create a root device directory in sysfs.
But they show up in the root directory in sysfs, in /sys/devices/ which
is not a good place to be. Why not make them part of a class, perhaps
called 'kunit', so that they will be in a contained place?
thanks,
greg k-h
Powered by blists - more mailing lists