diff options
| author | Uwe Kleine-König <u.kleine-koenig@baylibre.com> | 2025-12-09 15:38:51 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-12-14 13:08:10 +0300 |
| commit | a7b7afcc54cd51f60b840c173dc1223d1697750e (patch) | |
| tree | e7c85c4a28fada6b63753a23c373c5fb48f995e9 | |
| parent | 4b8da6d08944f78b17bd9e846c8e3e38625088a6 (diff) | |
| download | linux-a7b7afcc54cd51f60b840c173dc1223d1697750e.tar.xz | |
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 <u.kleine-koenig@baylibre.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/10adbd12b75984f6fd45e281438d475735cf5fdb.1765283601.git.u.kleine-koenig@baylibre.com
| -rw-r--r-- | sound/core/seq_device.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/sound/core/seq_device.c b/sound/core/seq_device.c index 01def5b739a6..1b062d6b17ea 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); |
