From patchwork Wed Dec 6 12:02:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13481714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F769C4167B for ; Wed, 6 Dec 2023 12:02:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7429710E6DF; Wed, 6 Dec 2023 12:02:12 +0000 (UTC) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5755F10E6DF for ; Wed, 6 Dec 2023 12:02:11 +0000 (UTC) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33334480eb4so793387f8f.0 for ; Wed, 06 Dec 2023 04:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701864130; x=1702468930; darn=lists.freedesktop.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=C9luEiqd3rNZRXjehlbFdnQ2e1wzzmxPWamwzOSoC4I=; b=OCcU1J3kEJyX/GvHG4Fr/ZvPxhJYVqSxR+jwyu/L7mbxZNroOVE/AB8W1ahiqTlinr ZSgl/dqyGyBmaNLK2OCZekxJq6rWAY12lbA7Iee+aNgQ8X1+dhDR2lA2PhxYQFfsQ05i 7ZBwn0BR5s7+yxosMKb4SwSdGQUtb3h+plB/WDtRnN8UyTGpjISoW6P7pUX6Qhd7MrG1 fwzevHCsri7znYxI/bHz1BMKV4GJFy/DVUECe0mFP8Nktbod3o2KaeeC0aEf8E5qQKVm rC1bJzmbRkMJ4ZXTVrN9jgIQHVvIqlGFSfLfDzq2GUHgljYAP9Q/EDttihne6j4yIo9g aukg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701864130; x=1702468930; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=C9luEiqd3rNZRXjehlbFdnQ2e1wzzmxPWamwzOSoC4I=; b=oGpErm7KngIwCkijwU84/LZnDUwgYq+ozO8Hg2jmg/6EQRQQPVSJ+ltRaCuR2A3ibH xkOX30nrzujksjeaYbDDqD/o/SrwhZRmBCRegpVHOKdSzg6TN7Sd4QR7d1eSeB5WL92/ OvMwiGEUk3mzAqBLxTd3QHRRZZKk1Ux+fh5JlMiSSDuB9MJ0bmT3Q989yU9YKh0t/EQt 8i8XTkG/uEKizGecsBQ6HQLL8Qh8j4ktIyGSdQ6EwXawTVM66ITAf8gkcyiovmDlFrh7 2ufEB7N3hp7Rlb/wQecUBYsORlTWocKLglp19n2FQqw/yOGmMdBRsGXSRXy9xD5O4Fue RAtg== X-Gm-Message-State: AOJu0YwWFfFGF3zyTK2fsJZNtxmXkrtTIlH8ST3oUhFi57ZAPhmRzHJh /0ndAmAe7GEzykiOLdE2BpiBVg== X-Google-Smtp-Source: AGHT+IFJokEpInd+DiAKxLDKJAGHst4aJ50KC/hLVyMjr37BE7LjVcnWh8PkujsMGpwy/wk3eMm1WA== X-Received: by 2002:a7b:cd0d:0:b0:40b:5e4a:4072 with SMTP id f13-20020a7bcd0d000000b0040b5e4a4072mr523452wmj.146.1701864129773; Wed, 06 Dec 2023 04:02:09 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id w17-20020a05600c475100b0040b45356b72sm25543935wmo.33.2023.12.06.04.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 04:02:09 -0800 (PST) Date: Wed, 6 Dec 2023 15:02:05 +0300 From: Dan Carpenter To: Kuogee Hsieh Subject: [PATCH] drm/msm/dp: Fix platform_get_irq() check Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, Bjorn Andersson , kernel-janitors@vger.kernel.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, Vinod Polimera , linux-arm-msm@vger.kernel.org, Dmitry Baryshkov , Marijn Suijten , Stephen Boyd , Sean Paul , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The platform_get_irq() function returns negative error codes. It never returns zero. Fix the check accordingly. Fixes: 82c2a5751227 ("drm/msm/dp: tie dp_display_irq_handler() with dp driver") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 61b7103498a7..d80cb3d14c6b 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1166,9 +1166,9 @@ static int dp_display_request_irq(struct dp_display_private *dp) struct platform_device *pdev = dp->dp_display.pdev; dp->irq = platform_get_irq(pdev, 0); - if (!dp->irq) { + if (dp->irq < 0) { DRM_ERROR("failed to get irq\n"); - return -EINVAL; + return dp->irq; } rc = devm_request_irq(&pdev->dev, dp->irq, dp_display_irq_handler,