Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3220521pxx; Mon, 2 Nov 2020 03:22:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx42C7fuTX3TtRCuSiFCTy+wXdY1zCUk5weyx0KrbcoxNyWUB/HHHbjg/M2Tq0pNJE5azBf X-Received: by 2002:a17:906:f753:: with SMTP id jp19mr14684627ejb.280.1604316130044; Mon, 02 Nov 2020 03:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604316130; cv=none; d=google.com; s=arc-20160816; b=HpH0lYKWyXZMUMl5qMYcTVZOBJOzLvl+TtF2kORzKNmwrnUevbUyKLf3nf5xdDbm5o J9Mk0GwuJ2E4ChHVmc1m6AjBXmGTskfn9XeJqq2YcsyBYl6pwtGx2mmYaqYi9FTkV+W5 eylVMbXWTeYgH56bhgpt2P5Dm9SRe4fLrwpJF0Yg5i1dg7MO2rY1cbz09bEwszWkGszr zvRd46HyfAA/JPZMW7fQx15QdqNSQFYQyx24UJyQiSNZI19MjQmP0LUdQ7e42ORbPX3z s5qzq4mNlOw6YI1a0J60LGLMMkNejiaBHU4jPuEKDGVyb0mLoCXHpbaPt9/oOkYkdXB1 M2qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=jYwti5Y6qDvSGYKxKKn8vcGn+se362zi32sgOSbhYE8=; b=fKq5p0/g+n/Xd6pxdObqBjB3ai9lLxZoDuLukVeGi50xfCYV+M59YNUeLicR4+TjXk PDpcv5NsE9aa7FHCRpM2VDyYS1yLJO2DVuXenrDbgozwbwl44NlREtuVQxtSJOmg50sE 3OffYG49rzz7gjVQ6NKMVGCXmMVingZw9GvG2WodrmXyVAWG10ao5KgyDS963hQhozlg ifWLxqfoTl74Lkaff7w2E5Xbl6pwIQsmEnnJMocBGD4p4/XqXJwOOcCHYhGHfeiU1U6v qvNGpfsAy5z56RlEAS1o5myvirEfM/V/rfRw/j5AVBChPj4XAAg+PFVq3EjhXcHtb+mX Ie7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si6864858ejz.656.2020.11.02.03.21.45; Mon, 02 Nov 2020 03:22:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728578AbgKBLT3 (ORCPT + 99 others); Mon, 2 Nov 2020 06:19:29 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:7442 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728253AbgKBLT3 (ORCPT ); Mon, 2 Nov 2020 06:19:29 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CPr5w50vVzhcCL; Mon, 2 Nov 2020 19:19:16 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Mon, 2 Nov 2020 19:19:15 +0800 From: Tian Tao To: , , , , , , Subject: [PATCH] drm/irq: Add irq as false detection Date: Mon, 2 Nov 2020 19:19:50 +0800 Message-ID: <1604315990-56787-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the detection of false for irq, so that the EINVAL is not returned when dev->irq_enabled is false. Signed-off-by: Tian Tao --- drivers/gpu/drm/drm_irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 09d6e9e..7537a3d 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -172,6 +172,9 @@ int drm_irq_uninstall(struct drm_device *dev) bool irq_enabled; int i; + if (!dev->irq_enabled || !dev) + return 0; + irq_enabled = dev->irq_enabled; dev->irq_enabled = false; -- 2.7.4