提交 94cd1ae2 编写于 作者: L Liu Yuan 提交者: Paul Mundt

video, udlfb: Fix two build warnings about 'ignoring return value'

build warning:

...
drivers/video/udlfb.c:1590: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result
drivers/video/udlfb.c:1592: warning: ignoring return value of ‘device_create_bin_file’, declared with attribute warn_unused_result
...

So add two checks to get rid of 'em.
Signed-off-by: NLiu Yuan <tailai.ly@taobao.com>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 6dbdf2a1
...@@ -1587,10 +1587,19 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1587,10 +1587,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
goto error; goto error;
} }
for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
device_create_file(info->dev, &fb_device_attrs[i]); retval = device_create_file(info->dev, &fb_device_attrs[i]);
if (retval) {
pr_err("device_create_file failed %d\n", retval);
goto err_del_attrs;
}
}
device_create_bin_file(info->dev, &edid_attr); retval = device_create_bin_file(info->dev, &edid_attr);
if (retval) {
pr_err("device_create_bin_file failed %d\n", retval);
goto err_del_attrs;
}
pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
" Using %dK framebuffer memory\n", info->node, " Using %dK framebuffer memory\n", info->node,
...@@ -1599,6 +1608,10 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1599,6 +1608,10 @@ static int dlfb_usb_probe(struct usb_interface *interface,
info->fix.smem_len * 2 : info->fix.smem_len) >> 10); info->fix.smem_len * 2 : info->fix.smem_len) >> 10);
return 0; return 0;
err_del_attrs:
for (i -= 1; i >= 0; i--)
device_remove_file(info->dev, &fb_device_attrs[i]);
error: error:
if (dev) { if (dev) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册