Merge git://git.infradead.org/intel-iommu
[deliverable/linux.git] / sound / hda / hda_bus_type.c
1 /*
2 * HD-audio bus
3 */
4 #include <linux/init.h>
5 #include <linux/device.h>
6 #include <linux/module.h>
7 #include <linux/export.h>
8 #include <sound/hdaudio.h>
9
10 MODULE_DESCRIPTION("HD-audio bus");
11 MODULE_LICENSE("GPL");
12
13 static int hda_bus_match(struct device *dev, struct device_driver *drv)
14 {
15 struct hdac_device *hdev = dev_to_hdac_dev(dev);
16 struct hdac_driver *hdrv = drv_to_hdac_driver(drv);
17
18 if (hdev->type != hdrv->type)
19 return 0;
20 if (hdrv->match)
21 return hdrv->match(hdev, hdrv);
22 return 1;
23 }
24
25 struct bus_type snd_hda_bus_type = {
26 .name = "hdaudio",
27 .match = hda_bus_match,
28 };
29 EXPORT_SYMBOL_GPL(snd_hda_bus_type);
30
31 static int __init hda_bus_init(void)
32 {
33 return bus_register(&snd_hda_bus_type);
34 }
35
36 static void __exit hda_bus_exit(void)
37 {
38 bus_unregister(&snd_hda_bus_type);
39 }
40
41 subsys_initcall(hda_bus_init);
42 module_exit(hda_bus_exit);
This page took 0.032642 seconds and 6 git commands to generate.