From: Thierry Reding Date: Wed, 12 Aug 2015 14:32:05 +0000 (+0200) Subject: vgaarb: Stop complaining about absent devices X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb6944f2fc01d5c83bce37fa0e68810565f78a75;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Daniel Vetter --- 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; }