diff options
author | Rakesh Ughreja <rakesh.a.ughreja@intel.com> | 2018-06-01 23:53:51 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-06-28 01:33:29 -0400 |
commit | e1df9317cbb192582ed7aa88c5f294c2336a3c75 (patch) | |
tree | 2d5e34f9a37181d332a7d4ee6d3cfa85f393257b /sound | |
parent | 76f56fae1cf9040325a58d1375291baf71dfaf03 (diff) |
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: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/hda/ext/hdac_ext_bus.c | 30 | ||||
-rw-r--r-- | sound/soc/codecs/hdac_hdmi.c | 12 |
2 files changed, 19 insertions, 23 deletions
diff --git a/sound/hda/ext/hdac_ext_bus.c b/sound/hda/ext/hdac_ext_bus.c index 77547ede9ae8..52f07766fff3 100644 --- a/sound/hda/ext/hdac_ext_bus.c +++ b/sound/hda/ext/hdac_ext_bus.c | |||
@@ -200,12 +200,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_remove); | |||
200 | #define dev_to_hdac(dev) (container_of((dev), \ | 200 | #define dev_to_hdac(dev) (container_of((dev), \ |
201 | struct hdac_device, dev)) | 201 | struct hdac_device, dev)) |
202 | 202 | ||
203 | static inline struct hdac_ext_driver *get_edrv(struct device *dev) | 203 | static inline struct hdac_driver *get_hdrv(struct device *dev) |
204 | { | 204 | { |
205 | struct hdac_driver *hdrv = drv_to_hdac_driver(dev->driver); | 205 | struct hdac_driver *hdrv = drv_to_hdac_driver(dev->driver); |
206 | struct hdac_ext_driver *edrv = to_ehdac_driver(hdrv); | 206 | return hdrv; |
207 | |||
208 | return edrv; | ||
209 | } | 207 | } |
210 | 208 | ||
211 | static inline struct hdac_device *get_hdev(struct device *dev) | 209 | 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 | 214 | ||
217 | static int hda_ext_drv_probe(struct device *dev) | 215 | static int hda_ext_drv_probe(struct device *dev) |
218 | { | 216 | { |
219 | return (get_edrv(dev))->probe(get_hdev(dev)); | 217 | return (get_hdrv(dev))->probe(get_hdev(dev)); |
220 | } | 218 | } |
221 | 219 | ||
222 | static int hdac_ext_drv_remove(struct device *dev) | 220 | static int hdac_ext_drv_remove(struct device *dev) |
223 | { | 221 | { |
224 | return (get_edrv(dev))->remove(get_hdev(dev)); | 222 | return (get_hdrv(dev))->remove(get_hdev(dev)); |
225 | } | 223 | } |
226 | 224 | ||
227 | static void hdac_ext_drv_shutdown(struct device *dev) | 225 | static void hdac_ext_drv_shutdown(struct device *dev) |
228 | { | 226 | { |
229 | return (get_edrv(dev))->shutdown(get_hdev(dev)); | 227 | return (get_hdrv(dev))->shutdown(get_hdev(dev)); |
230 | } | 228 | } |
231 | 229 | ||
232 | /** | 230 | /** |
@@ -234,20 +232,20 @@ static void hdac_ext_drv_shutdown(struct device *dev) | |||
234 | * | 232 | * |
235 | * @drv: ext hda driver structure | 233 | * @drv: ext hda driver structure |
236 | */ | 234 | */ |
237 | int snd_hda_ext_driver_register(struct hdac_ext_driver *drv) | 235 | int snd_hda_ext_driver_register(struct hdac_driver *drv) |
238 | { | 236 | { |
239 | drv->hdac.type = HDA_DEV_ASOC; | 237 | drv->type = HDA_DEV_ASOC; |
240 | drv->hdac.driver.bus = &snd_hda_bus_type; | 238 | drv->driver.bus = &snd_hda_bus_type; |
241 | /* we use default match */ | 239 | /* we use default match */ |
242 | 240 | ||
243 | if (drv->probe) | 241 | if (drv->probe) |
244 | drv->hdac.driver.probe = hda_ext_drv_probe; | 242 | drv->driver.probe = hda_ext_drv_probe; |
245 | if (drv->remove) | 243 | if (drv->remove) |
246 | drv->hdac.driver.remove = hdac_ext_drv_remove; | 244 | drv->driver.remove = hdac_ext_drv_remove; |
247 | if (drv->shutdown) | 245 | if (drv->shutdown) |
248 | drv->hdac.driver.shutdown = hdac_ext_drv_shutdown; | 246 | drv->driver.shutdown = hdac_ext_drv_shutdown; |
249 | 247 | ||
250 | return driver_register(&drv->hdac.driver); | 248 | return driver_register(&drv->driver); |
251 | } | 249 | } |
252 | EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register); | 250 | EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register); |
253 | 251 | ||
@@ -256,8 +254,8 @@ EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register); | |||
256 | * | 254 | * |
257 | * @drv: ext hda driver structure | 255 | * @drv: ext hda driver structure |
258 | */ | 256 | */ |
259 | void snd_hda_ext_driver_unregister(struct hdac_ext_driver *drv) | 257 | void snd_hda_ext_driver_unregister(struct hdac_driver *drv) |
260 | { | 258 | { |
261 | driver_unregister(&drv->hdac.driver); | 259 | driver_unregister(&drv->driver); |
262 | } | 260 | } |
263 | EXPORT_SYMBOL_GPL(snd_hda_ext_driver_unregister); | 261 | EXPORT_SYMBOL_GPL(snd_hda_ext_driver_unregister); |
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index c3ccc8d9c91d..3e3a2a9ef310 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c | |||
@@ -2186,14 +2186,12 @@ static const struct hda_device_id hdmi_list[] = { | |||
2186 | 2186 | ||
2187 | MODULE_DEVICE_TABLE(hdaudio, hdmi_list); | 2187 | MODULE_DEVICE_TABLE(hdaudio, hdmi_list); |
2188 | 2188 | ||
2189 | static struct hdac_ext_driver hdmi_driver = { | 2189 | static struct hdac_driver hdmi_driver = { |
2190 | . hdac = { | 2190 | .driver = { |
2191 | .driver = { | 2191 | .name = "HDMI HDA Codec", |
2192 | .name = "HDMI HDA Codec", | 2192 | .pm = &hdac_hdmi_pm, |
2193 | .pm = &hdac_hdmi_pm, | ||
2194 | }, | ||
2195 | .id_table = hdmi_list, | ||
2196 | }, | 2193 | }, |
2194 | .id_table = hdmi_list, | ||
2197 | .probe = hdac_hdmi_dev_probe, | 2195 | .probe = hdac_hdmi_dev_probe, |
2198 | .remove = hdac_hdmi_dev_remove, | 2196 | .remove = hdac_hdmi_dev_remove, |
2199 | }; | 2197 | }; |