Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Uwe Kleine-König and committed by
Takashi Iwai
a7b7afcc 4b8da6d0

+2 -25
+2 -25
sound/core/seq_device.c
··· 264 264 } 265 265 EXPORT_SYMBOL(snd_seq_device_new); 266 266 267 - static int snd_seq_driver_legacy_probe(struct snd_seq_device *sdev) 268 - { 269 - struct device *dev = &sdev->dev; 270 - struct device_driver *driver = dev->driver; 271 - 272 - return driver->probe(dev); 273 - } 274 - 275 - static void snd_seq_driver_legacy_remove(struct snd_seq_device *sdev) 276 - { 277 - struct device *dev = &sdev->dev; 278 - struct device_driver *driver = dev->driver; 279 - int ret; 280 - 281 - ret = driver->remove(dev); 282 - if (unlikely(ret)) 283 - dev_warn(dev, "Ignoring return value of remove callback (%pe)\n", ERR_PTR(ret)); 284 - } 285 - 286 267 /* 287 268 * driver registration 288 269 */ 289 270 int __snd_seq_driver_register(struct snd_seq_driver *drv, struct module *mod) 290 271 { 291 - if (WARN_ON(!drv->driver.name || !drv->id)) 272 + if (WARN_ON(!drv->driver.name || !drv->id || drv->driver.probe || drv->driver.remove)) 292 273 return -EINVAL; 274 + 293 275 drv->driver.bus = &snd_seq_bus_type; 294 276 drv->driver.owner = mod; 295 - 296 - if (!drv->probe && drv->driver.probe) 297 - drv->probe = snd_seq_driver_legacy_probe; 298 - if (!drv->remove && drv->driver.remove) 299 - drv->remove = snd_seq_driver_legacy_remove; 300 277 301 278 return driver_register(&drv->driver); 302 279 }