From a7b7afcc54cd51f60b840c173dc1223d1697750e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 9 Dec 2025 13:38:51 +0100 Subject: [PATCH] ALSA: seq: Refuse to probe seq drivers with non-bus probe or remove MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now that all in-tree seq drivers are converted to bus methods, let old-style drivers fails to probe until driver methods are removed. Signed-off-by: Uwe Kleine-König Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/10adbd12b75984f6fd45e281438d475735cf5fdb.1765283601.git.u.kleine-koenig@baylibre.com --- sound/core/seq_device.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/sound/core/seq_device.c b/sound/core/seq_device.c index 01def5b739a62..1b062d6b17ea8 100644 --- a/sound/core/seq_device.c +++ b/sound/core/seq_device.c @@ -264,40 +264,17 @@ int snd_seq_device_new(struct snd_card *card, int device, const char *id, } EXPORT_SYMBOL(snd_seq_device_new); -static int snd_seq_driver_legacy_probe(struct snd_seq_device *sdev) -{ - struct device *dev = &sdev->dev; - struct device_driver *driver = dev->driver; - - return driver->probe(dev); -} - -static void snd_seq_driver_legacy_remove(struct snd_seq_device *sdev) -{ - struct device *dev = &sdev->dev; - struct device_driver *driver = dev->driver; - int ret; - - ret = driver->remove(dev); - if (unlikely(ret)) - dev_warn(dev, "Ignoring return value of remove callback (%pe)\n", ERR_PTR(ret)); -} - /* * driver registration */ int __snd_seq_driver_register(struct snd_seq_driver *drv, struct module *mod) { - if (WARN_ON(!drv->driver.name || !drv->id)) + if (WARN_ON(!drv->driver.name || !drv->id || drv->driver.probe || drv->driver.remove)) return -EINVAL; + drv->driver.bus = &snd_seq_bus_type; drv->driver.owner = mod; - if (!drv->probe && drv->driver.probe) - drv->probe = snd_seq_driver_legacy_probe; - if (!drv->remove && drv->driver.remove) - drv->remove = snd_seq_driver_legacy_remove; - return driver_register(&drv->driver); } EXPORT_SYMBOL_GPL(__snd_seq_driver_register); -- 2.47.3