gpio: introduce utilities for synchronous fake device creation
authorKoichiro Den <koichiro.den@canonical.com>
Fri, 21 Feb 2025 13:34:59 +0000 (22:34 +0900)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 24 Feb 2025 13:57:39 +0000 (14:57 +0100)
commiteb5ab6ffb4ca2d28121455dd7452061367ed5588
treef53f71cb6bbbbb4abed1afb49c79a99fc64d97e1
parent11067f50458a5bb3b72f83c508e03f321e0c0c34
gpio: introduce utilities for synchronous fake device creation

Both gpio-sim and gpio-virtuser share a mechanism to instantiate a
platform device, wait for probe completion, and retrieve the probe
success or error status synchronously. With gpio-aggregator planned to
adopt this approach for its configfs interface, it's time to factor
out the common code.

Add dev-sync-probe.[ch] to house helper functions used by all such
implementations.

No functional change.

Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Link: https://lore.kernel.org/r/20250221133501.2203897-2-koichiro.den@canonical.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/dev-sync-probe.c [new file with mode: 0644]
drivers/gpio/dev-sync-probe.h [new file with mode: 0644]