]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drivers: base: test: Add ...find_device_by...(... NULL) tests
authorBrian Norris <briannorris@chromium.org>
Mon, 16 Dec 2024 20:11:44 +0000 (12:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Dec 2024 08:48:09 +0000 (09:48 +0100)
commit86a5f32ed8813d5534d3d6c77aad29184a9f99b6
treef028ce734071475fd085107173be6f9f3c907e90
parent55b7aee990ef786251e0e37f8285c32b4193f419
drivers: base: test: Add ...find_device_by...(... NULL) tests

We recently updated these device_match*() (and therefore, various
*find_device_by*()) functions to return a consistent 'false' value when
trying to match a NULL handle. Add tests for this.

This provides regression-testing coverage for the sorts of bugs that
underly commit 5c8418cf4025 ("PCI/pwrctrl: Unregister platform device
only if one actually exists").

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Reviewed-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/r/20241216201148.535115-4-briannorris@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/test/platform-device-test.c