From: Uwe Kleine-König Date: Tue, 9 Dec 2025 12:38:51 +0000 (+0100) Subject: ALSA: seq: Refuse to probe seq drivers with non-bus probe or remove X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7b7afcc54cd51f60b840c173dc1223d1697750e;p=thirdparty%2Fkernel%2Flinux.git ALSA: seq: Refuse to probe seq drivers with non-bus probe or remove 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 --- 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);