Revert "UPSTREAM: usb: gadget: f_uac2: validate input parameters"

This reverts commit 02c79c7ec4.

This came into android13-5.10 via the 5.10.36 stable merge as
commit f63390de9b ("usb: gadget: f_uac2: validate input parameters").
It being present twice breaks the build because afunc_validate_opts is
defined twice.

Revert this copy so everything builds properly.

Change-Id: I8377520e483604ae34ce8150096cd2239cbc1abb
Link: https://builds.tuxbuild.com/1sRu81vp9EmQWd4r3jPXns8EZwt/build.log
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
Nathan Chancellor
2021-05-12 13:54:38 -07:00
parent 02c79c7ec4
commit 54b5fe07a6

View File

@@ -637,36 +637,6 @@ static int afunc_validate_opts(struct g_audio *agdev, struct device *dev)
return 0;
}
static int afunc_validate_opts(struct g_audio *agdev, struct device *dev)
{
struct f_uac2_opts *opts = g_audio_to_uac2_opts(agdev);
if (!opts->p_chmask && !opts->c_chmask) {
dev_err(dev, "Error: no playback and capture channels\n");
return -EINVAL;
} else if (opts->p_chmask & ~UAC2_CHANNEL_MASK) {
dev_err(dev, "Error: unsupported playback channels mask\n");
return -EINVAL;
} else if (opts->c_chmask & ~UAC2_CHANNEL_MASK) {
dev_err(dev, "Error: unsupported capture channels mask\n");
return -EINVAL;
} else if ((opts->p_ssize < 1) || (opts->p_ssize > 4)) {
dev_err(dev, "Error: incorrect playback sample size\n");
return -EINVAL;
} else if ((opts->c_ssize < 1) || (opts->c_ssize > 4)) {
dev_err(dev, "Error: incorrect capture sample size\n");
return -EINVAL;
} else if (!opts->p_srate) {
dev_err(dev, "Error: incorrect playback sampling rate\n");
return -EINVAL;
} else if (!opts->c_srate) {
dev_err(dev, "Error: incorrect capture sampling rate\n");
return -EINVAL;
}
return 0;
}
static int
afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
{