提交 a8147dab 编写于 作者: D Daniel Mack 提交者: Felipe Balbi

usb: gadget: f_uac2: add short-hand for 'dev'

In afunc_bind() and afunc_set_alt(), &uac2->pdev.dev are used multiple
times. Adding a short-hand for them makes lines shorter so we can
remove some line wraps.

No functional change.
Signed-off-by: NDaniel Mack <zonque@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 430fdbd3
......@@ -918,6 +918,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
struct snd_uac2_chip *uac2 = &agdev->uac2;
struct usb_composite_dev *cdev = cfg->cdev;
struct usb_gadget *gadget = cdev->gadget;
struct device *dev = &uac2->pdev.dev;
struct uac2_rtd_params *prm;
struct f_uac2_opts *uac2_opts;
struct usb_string *us;
......@@ -961,8 +962,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
ret = usb_interface_id(cfg, fn);
if (ret < 0) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return ret;
}
std_ac_if_desc.bInterfaceNumber = ret;
......@@ -971,8 +971,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
ret = usb_interface_id(cfg, fn);
if (ret < 0) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return ret;
}
std_as_out_if0_desc.bInterfaceNumber = ret;
......@@ -982,8 +981,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
ret = usb_interface_id(cfg, fn);
if (ret < 0) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return ret;
}
std_as_in_if0_desc.bInterfaceNumber = ret;
......@@ -993,16 +991,14 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc);
if (!agdev->out_ep) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
goto err;
}
agdev->out_ep->driver_data = agdev;
agdev->in_ep = usb_ep_autoconfig(gadget, &fs_epin_desc);
if (!agdev->in_ep) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
goto err;
}
agdev->in_ep->driver_data = agdev;
......@@ -1057,6 +1053,7 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
struct audio_dev *agdev = func_to_agdev(fn);
struct snd_uac2_chip *uac2 = &agdev->uac2;
struct usb_gadget *gadget = cdev->gadget;
struct device *dev = &uac2->pdev.dev;
struct usb_request *req;
struct usb_ep *ep;
struct uac2_rtd_params *prm;
......@@ -1064,16 +1061,14 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
/* No i/f has more than 2 alt settings */
if (alt > 1) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return -EINVAL;
}
if (intf == agdev->ac_intf) {
/* Control I/f has only 1 AltSetting - 0 */
if (alt) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return -EINVAL;
}
return 0;
......@@ -1090,8 +1085,7 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
config_ep_by_speed(gadget, fn, ep);
agdev->as_in_alt = alt;
} else {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return -EINVAL;
}
......@@ -1120,8 +1114,7 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
}
if (usb_ep_queue(ep, prm->ureq[i].req, GFP_ATOMIC))
dev_err(&uac2->pdev.dev, "%s:%d Error!\n",
__func__, __LINE__);
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册