diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-03-27 13:31:14 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-04-07 13:32:28 +0300 |
| commit | dd84f7ce6fd12fb5d6648d6b5d8ea4bf6f834273 (patch) | |
| tree | e7a773ea11f5f325c47f57f81e3030bb9d2b07c3 | |
| parent | c3e2a8aef28c48a94c0cf0525ca96aa308bcf961 (diff) | |
| download | linux-dd84f7ce6fd12fb5d6648d6b5d8ea4bf6f834273.tar.xz | |
gpio: remove dev-sync-probe
There are no more users. Remove the dev-sync-probe module.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260327-gpio-kill-dev-sync-probe-v1-4-efac254f1a1d@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
| -rw-r--r-- | drivers/gpio/Kconfig | 3 | ||||
| -rw-r--r-- | drivers/gpio/Makefile | 3 | ||||
| -rw-r--r-- | drivers/gpio/dev-sync-probe.c | 97 | ||||
| -rw-r--r-- | drivers/gpio/dev-sync-probe.h | 25 |
4 files changed, 0 insertions, 128 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 6dd2e08b9be6..536af328b56e 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -2108,6 +2108,3 @@ config GPIO_VIRTUSER endmenu endif - -config DEV_SYNC_PROBE - tristate diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 13ff2a129354..b267598b517d 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -21,9 +21,6 @@ obj-$(CONFIG_GPIO_GENERIC) += gpio-generic.o # directly supported by gpio-generic gpio-generic-$(CONFIG_GPIO_GENERIC) += gpio-mmio.o -# Utilities for drivers that need synchronous fake device creation -obj-$(CONFIG_DEV_SYNC_PROBE) += dev-sync-probe.o - obj-$(CONFIG_GPIO_104_DIO_48E) += gpio-104-dio-48e.o obj-$(CONFIG_GPIO_104_IDI_48) += gpio-104-idi-48.o obj-$(CONFIG_GPIO_104_IDIO_16) += gpio-104-idio-16.o diff --git a/drivers/gpio/dev-sync-probe.c b/drivers/gpio/dev-sync-probe.c deleted file mode 100644 index 9ea733b863b2..000000000000 --- a/drivers/gpio/dev-sync-probe.c +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Common code for drivers creating fake platform devices. - * - * Provides synchronous device creation: waits for probe completion and - * returns the probe success or error status to the device creator. - * - * Copyright (C) 2021 Bartosz Golaszewski <brgl@bgdev.pl> - * Copyright (C) 2025 Koichiro Den <koichiro.den@canonical.com> - */ - -#include <linux/device.h> -#include <linux/slab.h> - -#include "dev-sync-probe.h" - -static int dev_sync_probe_notifier_call(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct dev_sync_probe_data *pdata; - struct device *dev = data; - - pdata = container_of(nb, struct dev_sync_probe_data, bus_notifier); - if (!device_match_name(dev, pdata->name)) - return NOTIFY_DONE; - - switch (action) { - case BUS_NOTIFY_BOUND_DRIVER: - pdata->driver_bound = true; - break; - case BUS_NOTIFY_DRIVER_NOT_BOUND: - pdata->driver_bound = false; - break; - default: - return NOTIFY_DONE; - } - - complete(&pdata->probe_completion); - return NOTIFY_OK; -} - -void dev_sync_probe_init(struct dev_sync_probe_data *data) -{ - memset(data, 0, sizeof(*data)); - init_completion(&data->probe_completion); - data->bus_notifier.notifier_call = dev_sync_probe_notifier_call; -} -EXPORT_SYMBOL_GPL(dev_sync_probe_init); - -int dev_sync_probe_register(struct dev_sync_probe_data *data, - struct platform_device_info *pdevinfo) -{ - struct platform_device *pdev; - char *name; - - name = kasprintf(GFP_KERNEL, "%s.%d", pdevinfo->name, pdevinfo->id); - if (!name) - return -ENOMEM; - - data->driver_bound = false; - data->name = name; - reinit_completion(&data->probe_completion); - bus_register_notifier(&platform_bus_type, &data->bus_notifier); - - pdev = platform_device_register_full(pdevinfo); - if (IS_ERR(pdev)) { - bus_unregister_notifier(&platform_bus_type, &data->bus_notifier); - kfree(data->name); - return PTR_ERR(pdev); - } - - wait_for_completion(&data->probe_completion); - bus_unregister_notifier(&platform_bus_type, &data->bus_notifier); - - if (!data->driver_bound) { - platform_device_unregister(pdev); - kfree(data->name); - return -ENXIO; - } - - data->pdev = pdev; - return 0; -} -EXPORT_SYMBOL_GPL(dev_sync_probe_register); - -void dev_sync_probe_unregister(struct dev_sync_probe_data *data) -{ - platform_device_unregister(data->pdev); - kfree(data->name); - data->pdev = NULL; -} -EXPORT_SYMBOL_GPL(dev_sync_probe_unregister); - -MODULE_AUTHOR("Bartosz Golaszewski <brgl@bgdev.pl>"); -MODULE_AUTHOR("Koichiro Den <koichiro.den@canonical.com>"); -MODULE_DESCRIPTION("Utilities for synchronous fake device creation"); -MODULE_LICENSE("GPL"); diff --git a/drivers/gpio/dev-sync-probe.h b/drivers/gpio/dev-sync-probe.h deleted file mode 100644 index 4b3d52b70519..000000000000 --- a/drivers/gpio/dev-sync-probe.h +++ /dev/null @@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#ifndef DEV_SYNC_PROBE_H -#define DEV_SYNC_PROBE_H - -#include <linux/completion.h> -#include <linux/notifier.h> -#include <linux/platform_device.h> - -struct dev_sync_probe_data { - struct platform_device *pdev; - const char *name; - - /* Synchronize with probe */ - struct notifier_block bus_notifier; - struct completion probe_completion; - bool driver_bound; -}; - -void dev_sync_probe_init(struct dev_sync_probe_data *data); -int dev_sync_probe_register(struct dev_sync_probe_data *data, - struct platform_device_info *pdevinfo); -void dev_sync_probe_unregister(struct dev_sync_probe_data *data); - -#endif /* DEV_SYNC_PROBE_H */ |
