Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Koichiro Den <koichiro.den@canonical.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: [PATCH 4/4] gpio: remove dev-sync-probe
Date: Fri, 27 Mar 2026 11:31:14 +0100	[thread overview]
Message-ID: <20260327-gpio-kill-dev-sync-probe-v1-4-efac254f1a1d@oss.qualcomm.com> (raw)
In-Reply-To: <20260327-gpio-kill-dev-sync-probe-v1-0-efac254f1a1d@oss.qualcomm.com>

There are no more users. Remove the dev-sync-probe module.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/gpio/Kconfig          |  3 --
 drivers/gpio/Makefile         |  3 --
 drivers/gpio/dev-sync-probe.c | 97 -------------------------------------------
 drivers/gpio/dev-sync-probe.h | 25 -----------
 4 files changed, 128 deletions(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 56a7ddaa95eac07ee4f7b755335595805a316319..257123b3568688ad86a742043af2c6e098a56c3c 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -2082,6 +2082,3 @@ config GPIO_VIRTUSER
 endmenu
 
 endif
-
-config DEV_SYNC_PROBE
-	tristate
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 20d4a57afdaa6db0d01cd7e107a2e22004641ecb..199b9559a1892c4fce058cb95907de0be5d85780 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 9ea733b863b2232a16ef9ccc411f180b43bad26e..0000000000000000000000000000000000000000
--- 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 4b3d52b705198dd153618b087ba9d813736a6f29..0000000000000000000000000000000000000000
--- 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 */

-- 
2.47.3


  parent reply	other threads:[~2026-03-27 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27 10:31 [PATCH 0/4] gpio: kill dev-sync-probe Bartosz Golaszewski
2026-03-27 10:31 ` [PATCH 1/4] gpio: sim: stop using dev-sync-probe Bartosz Golaszewski
2026-03-27 10:31 ` [PATCH 2/4] gpio: aggregator: " Bartosz Golaszewski
2026-04-02 12:45   ` Bartosz Golaszewski
2026-03-27 10:31 ` [PATCH 3/4] gpio: virtuser: " Bartosz Golaszewski
2026-03-27 10:31 ` Bartosz Golaszewski [this message]
2026-03-27 13:03 ` [PATCH 0/4] gpio: kill dev-sync-probe Linus Walleij
2026-04-07 10:44 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260327-gpio-kill-dev-sync-probe-v1-4-efac254f1a1d@oss.qualcomm.com \
    --to=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=koichiro.den@canonical.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).