ALSA: hda: Remove codec init and exit routines
authorCezary Rojewski <cezary.rojewski@intel.com>
Tue, 16 Aug 2022 11:17:26 +0000 (13:17 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 18 Aug 2022 07:47:09 +0000 (09:47 +0200)
There are no users for snd_hdac_ext_bus_device_init() and
snd_hdac_ext_bus_device_exit().

While at it, remove hdac_to_hda_priv() too for the exact same reason.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220816111727.3218543-6-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hda_codec.h
include/sound/hdaudio_ext.h
sound/hda/ext/hdac_ext_bus.c

index 6d3c82c..2a8fe72 100644 (file)
@@ -293,8 +293,6 @@ struct hda_codec {
 #define dev_to_hda_codec(_dev) container_of(_dev, struct hda_codec, core.dev)
 #define hda_codec_dev(_dev)    (&(_dev)->core.dev)
 
-#define hdac_to_hda_priv(_hdac) \
-                       container_of(_hdac, struct hdac_hda_priv, codec.core)
 #define hdac_to_hda_codec(_hdac) container_of(_hdac, struct hda_codec, core)
 
 #define list_for_each_codec(c, bus) \
index d26234f..88ebb64 100644 (file)
@@ -11,9 +11,6 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
                      const struct hdac_ext_bus_ops *ext_ops);
 
 void snd_hdac_ext_bus_exit(struct hdac_bus *bus);
-int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,
-                               struct hdac_device *hdev, int type);
-void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev);
 void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus);
 
 #define HDA_CODEC_REV_EXT_ENTRY(_vid, _rev, _name, drv_data) \
index 765c40a..6004ea1 100644 (file)
@@ -60,59 +60,6 @@ void snd_hdac_ext_bus_exit(struct hdac_bus *bus)
 }
 EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_exit);
 
-static void default_release(struct device *dev)
-{
-       snd_hdac_ext_bus_device_exit(dev_to_hdac_dev(dev));
-}
-
-/**
- * snd_hdac_ext_bus_device_init - initialize the HDA extended codec base device
- * @bus: hdac bus to attach to
- * @addr: codec address
- * @hdev: hdac device to init
- * @type: codec type (HDAC_DEV_*) to use for this device
- *
- * Returns zero for success or a negative error code.
- */
-int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,
-                                struct hdac_device *hdev, int type)
-{
-       char name[15];
-       int ret;
-
-       hdev->bus = bus;
-
-       snprintf(name, sizeof(name), "ehdaudio%dD%d", bus->idx, addr);
-
-       ret  = snd_hdac_device_init(hdev, bus, name, addr);
-       if (ret < 0) {
-               dev_err(bus->dev, "device init failed for hdac device\n");
-               return ret;
-       }
-       hdev->type = type;
-       hdev->dev.release = default_release;
-
-       ret = snd_hdac_device_register(hdev);
-       if (ret) {
-               dev_err(bus->dev, "failed to register hdac device\n");
-               snd_hdac_ext_bus_device_exit(hdev);
-               return ret;
-       }
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init);
-
-/**
- * snd_hdac_ext_bus_device_exit - clean up a HD-audio extended codec base device
- * @hdev: hdac device to clean up
- */
-void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev)
-{
-       snd_hdac_device_exit(hdev);
-}
-EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);
-
 /**
  * snd_hdac_ext_bus_device_remove - remove HD-audio extended codec base devices
  *