Add a simple container_of() wrapper to get a struct f_uac2_opts from a
struct struct audio_dev. Use it in two places where it is currently
open-coded.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
        return container_of(p, struct snd_uac2_chip, pdev);
 }
 
+static inline
+struct f_uac2_opts *agdev_to_uac2_opts(struct audio_dev *agdev)
+{
+       return container_of(agdev->func.fi, struct f_uac2_opts, func_inst);
+}
+
 static inline
 uint num_channels(uint chanmask)
 {
        int value = -EOPNOTSUPP;
        int p_srate, c_srate;
 
-       opts = container_of(agdev->func.fi, struct f_uac2_opts, func_inst);
+       opts = agdev_to_uac2_opts(agdev);
        p_srate = opts->p_srate;
        c_srate = opts->c_srate;
 
        int value = -EOPNOTSUPP;
        int p_srate, c_srate;
 
-       opts = container_of(agdev->func.fi, struct f_uac2_opts, func_inst);
+       opts = agdev_to_uac2_opts(agdev);
        p_srate = opts->p_srate;
        c_srate = opts->c_srate;