mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
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
This commit is contained in:
parent
4b8da6d089
commit
a7b7afcc54
1 changed files with 2 additions and 25 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue