Commit e1df9317 authored by Rakesh Ughreja's avatar Rakesh Ughreja Committed by Takashi Iwai

ALSA: hdac: Remove usage of struct hdac_ext_driver, use hdac_driver instead

This patch removes the hdac_ext_driver structure. The legacy and
enhanced HDaudio capabilities can be handled in a backward-compatible
way without separate definitions.
Signed-off-by: default avatarRakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 76f56fae
...@@ -188,6 +188,11 @@ struct hdac_driver { ...@@ -188,6 +188,11 @@ struct hdac_driver {
const struct hda_device_id *id_table; const struct hda_device_id *id_table;
int (*match)(struct hdac_device *dev, struct hdac_driver *drv); int (*match)(struct hdac_device *dev, struct hdac_driver *drv);
void (*unsol_event)(struct hdac_device *dev, unsigned int event); void (*unsol_event)(struct hdac_device *dev, unsigned int event);
/* fields used by ext bus APIs */
int (*probe)(struct hdac_device *dev);
int (*remove)(struct hdac_device *dev);
void (*shutdown)(struct hdac_device *dev);
}; };
#define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver) #define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver)
......
...@@ -160,20 +160,7 @@ struct hdac_ext_dma_params { ...@@ -160,20 +160,7 @@ struct hdac_ext_dma_params {
u8 stream_tag; u8 stream_tag;
}; };
/* int snd_hda_ext_driver_register(struct hdac_driver *drv);
* HD-audio codec base driver void snd_hda_ext_driver_unregister(struct hdac_driver *drv);
*/
struct hdac_ext_driver {
struct hdac_driver hdac;
int (*probe)(struct hdac_device *dev);
int (*remove)(struct hdac_device *dev);
void (*shutdown)(struct hdac_device *dev);
};
int snd_hda_ext_driver_register(struct hdac_ext_driver *drv);
void snd_hda_ext_driver_unregister(struct hdac_ext_driver *drv);
#define to_ehdac_driver(_drv) container_of(_drv, struct hdac_ext_driver, hdac)
#endif /* __SOUND_HDAUDIO_EXT_H */ #endif /* __SOUND_HDAUDIO_EXT_H */
...@@ -200,12 +200,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_remove); ...@@ -200,12 +200,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_remove);
#define dev_to_hdac(dev) (container_of((dev), \ #define dev_to_hdac(dev) (container_of((dev), \
struct hdac_device, dev)) struct hdac_device, dev))
static inline struct hdac_ext_driver *get_edrv(struct device *dev) static inline struct hdac_driver *get_hdrv(struct device *dev)
{ {
struct hdac_driver *hdrv = drv_to_hdac_driver(dev->driver); struct hdac_driver *hdrv = drv_to_hdac_driver(dev->driver);
struct hdac_ext_driver *edrv = to_ehdac_driver(hdrv); return hdrv;
return edrv;
} }
static inline struct hdac_device *get_hdev(struct device *dev) static inline struct hdac_device *get_hdev(struct device *dev)
...@@ -216,17 +214,17 @@ static inline struct hdac_device *get_hdev(struct device *dev) ...@@ -216,17 +214,17 @@ static inline struct hdac_device *get_hdev(struct device *dev)
static int hda_ext_drv_probe(struct device *dev) static int hda_ext_drv_probe(struct device *dev)
{ {
return (get_edrv(dev))->probe(get_hdev(dev)); return (get_hdrv(dev))->probe(get_hdev(dev));
} }
static int hdac_ext_drv_remove(struct device *dev) static int hdac_ext_drv_remove(struct device *dev)
{ {
return (get_edrv(dev))->remove(get_hdev(dev)); return (get_hdrv(dev))->remove(get_hdev(dev));
} }
static void hdac_ext_drv_shutdown(struct device *dev) static void hdac_ext_drv_shutdown(struct device *dev)
{ {
return (get_edrv(dev))->shutdown(get_hdev(dev)); return (get_hdrv(dev))->shutdown(get_hdev(dev));
} }
/** /**
...@@ -234,20 +232,20 @@ static void hdac_ext_drv_shutdown(struct device *dev) ...@@ -234,20 +232,20 @@ static void hdac_ext_drv_shutdown(struct device *dev)
* *
* @drv: ext hda driver structure * @drv: ext hda driver structure
*/ */
int snd_hda_ext_driver_register(struct hdac_ext_driver *drv) int snd_hda_ext_driver_register(struct hdac_driver *drv)
{ {
drv->hdac.type = HDA_DEV_ASOC; drv->type = HDA_DEV_ASOC;
drv->hdac.driver.bus = &snd_hda_bus_type; drv->driver.bus = &snd_hda_bus_type;
/* we use default match */ /* we use default match */
if (drv->probe) if (drv->probe)
drv->hdac.driver.probe = hda_ext_drv_probe; drv->driver.probe = hda_ext_drv_probe;
if (drv->remove) if (drv->remove)
drv->hdac.driver.remove = hdac_ext_drv_remove; drv->driver.remove = hdac_ext_drv_remove;
if (drv->shutdown) if (drv->shutdown)
drv->hdac.driver.shutdown = hdac_ext_drv_shutdown; drv->driver.shutdown = hdac_ext_drv_shutdown;
return driver_register(&drv->hdac.driver); return driver_register(&drv->driver);
} }
EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register); EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register);
...@@ -256,8 +254,8 @@ EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register); ...@@ -256,8 +254,8 @@ EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register);
* *
* @drv: ext hda driver structure * @drv: ext hda driver structure
*/ */
void snd_hda_ext_driver_unregister(struct hdac_ext_driver *drv) void snd_hda_ext_driver_unregister(struct hdac_driver *drv)
{ {
driver_unregister(&drv->hdac.driver); driver_unregister(&drv->driver);
} }
EXPORT_SYMBOL_GPL(snd_hda_ext_driver_unregister); EXPORT_SYMBOL_GPL(snd_hda_ext_driver_unregister);
...@@ -2186,14 +2186,12 @@ static const struct hda_device_id hdmi_list[] = { ...@@ -2186,14 +2186,12 @@ static const struct hda_device_id hdmi_list[] = {
MODULE_DEVICE_TABLE(hdaudio, hdmi_list); MODULE_DEVICE_TABLE(hdaudio, hdmi_list);
static struct hdac_ext_driver hdmi_driver = { static struct hdac_driver hdmi_driver = {
. hdac = { .driver = {
.driver = { .name = "HDMI HDA Codec",
.name = "HDMI HDA Codec", .pm = &hdac_hdmi_pm,
.pm = &hdac_hdmi_pm,
},
.id_table = hdmi_list,
}, },
.id_table = hdmi_list,
.probe = hdac_hdmi_dev_probe, .probe = hdac_hdmi_dev_probe,
.remove = hdac_hdmi_dev_remove, .remove = hdac_hdmi_dev_remove,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment