aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/vga/vgaarb.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-08-12 16:32:05 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-08-12 17:11:57 +0200
commiteb6944f2fc01d5c83bce37fa0e68810565f78a75 (patch)
tree5af8630beafa0287c548acd70c19de46ccc2657d /drivers/gpu/vga/vgaarb.c
parent845249172a363c2217af5926fac17f58c7228aa4 (diff)
vgaarb: Stop complaining about absent devices
Some setups do not register a default VGA device, in which case the VGA arbiter will still complain about the (non-existent) PCI device being a non-VGA device. Fix this by making the error message conditional on a default VGA device having been set up. Note that the easy route of erroring out early isn't going to work because otherwise priv->target won't be properly updated. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/vga/vgaarb.c')
-rw-r--r--drivers/gpu/vga/vgaarb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 7bcbf863656e..3b1e65b3d454 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1091,8 +1091,11 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
vgadev = vgadev_find(pdev);
pr_debug("vgaarb: vgadev %p\n", vgadev);
if (vgadev == NULL) {
- pr_err("vgaarb: this pci device is not a vga device\n");
- pci_dev_put(pdev);
+ if (pdev) {
+ pr_err("vgaarb: this pci device is not a vga device\n");
+ pci_dev_put(pdev);
+ }
+
ret_val = -ENODEV;
goto done;
}

Privacy Policy