Merge tag 'drm-intel-fixes-2015-06-05' of git://anongit.freedesktop.org/drm-intel...
[deliverable/linux.git] / sound / hda / hda_bus_type.c
CommitLineData
e3d280fc
TI
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
10MODULE_DESCRIPTION("HD-audio bus");
11MODULE_LICENSE("GPL");
12
13static 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
25struct bus_type snd_hda_bus_type = {
26 .name = "hdaudio",
27 .match = hda_bus_match,
28};
29EXPORT_SYMBOL_GPL(snd_hda_bus_type);
30
31static int __init hda_bus_init(void)
32{
33 return bus_register(&snd_hda_bus_type);
34}
35
36static void __exit hda_bus_exit(void)
37{
38 bus_unregister(&snd_hda_bus_type);
39}
40
41subsys_initcall(hda_bus_init);
42module_exit(hda_bus_exit);
This page took 0.033739 seconds and 5 git commands to generate.