From patchwork Fri May 8 10:47:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 6363971 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 730B59F1C2 for ; Fri, 8 May 2015 10:47:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B06F5201B9 for ; Fri, 8 May 2015 10:47:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DCE8820165 for ; Fri, 8 May 2015 10:47:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 501AB6E768; Fri, 8 May 2015 03:47:31 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by gabe.freedesktop.org (Postfix) with ESMTP id C5F9C6E6BB for ; Fri, 8 May 2015 03:47:29 -0700 (PDT) Received: by pdbnk13 with SMTP id nk13so76639154pdb.0 for ; Fri, 08 May 2015 03:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=tMbvsD1xha/zh5T3uFmJp5MQ9+ADOFtdGruNh19TT8c=; b=iRcbGpr2E+gnE3Ud7ZlsnZS3v/CPR2tCgCBCgJST/SA30HQ4d2LHsJgyaYKSC3aNkv QX1ajczbRicmLVf5cYuX3tQataWK9FDRzuOMjAnkc0W5wObnxxQRdbUUtZIOJvQkAUTS H8+GHlundOoR33qdH+3BlWourGqI1SZX7KL9exBKGKLpk7e4mudVg3ngfETrrc5ArFz0 y5+CleozYEuIlrxU8eAXRwGrMhF8YeAASyC3ZwyoRlVbRuupyl/3g7JQ7ZFl7iUQ0ChU P3W0CK+LLaCrcFnETfn0b33/YAReFrSEBl09SjM8rFFRy6y5IncbFYu4oIwYLx4/Vtzi EwiQ== X-Received: by 10.68.167.98 with SMTP id zn2mr5304432pbb.163.1431082032651; Fri, 08 May 2015 03:47:12 -0700 (PDT) Received: from localhost ([216.228.120.20]) by mx.google.com with ESMTPSA id os7sm4820820pdb.51.2015.05.08.03.47.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2015 03:47:12 -0700 (PDT) From: Thierry Reding To: David Airlie Subject: [PATCH] vgaarb: Stop complaining about absent devices Date: Fri, 8 May 2015 12:47:08 +0200 Message-Id: <1431082028-18459-1-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.3.5 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding 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 --- drivers/gpu/vga/vgaarb.c | 7 +++++-- 1 file 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; }