From patchwork Mon May 10 03:16:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 433017 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2468443jao; Sun, 9 May 2021 20:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8xknz2ciNblOV2iBGAU3Lcuae0QAT4zFu9qKXk7CntA4Sjmgs3+dmz77jlbd+Grczw5Jt X-Received: by 2002:a05:6402:254a:: with SMTP id l10mr27165696edb.145.1620616589261; Sun, 09 May 2021 20:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620616589; cv=none; d=google.com; s=arc-20160816; b=FM7MNPtdavstcjUvrzPGxhe0XDI3J8xpu1jgRJFeN07BAxOes/sZBbqS2VLFoF83mM wZPpPk5SXVkIQxvA3q66PhBFl49XuY8lkONJd7X3Wia6jPfKx9epZ6TRd56Ahox5oqos 5eVOm4liVWWzwEKuMgeja0OAoVKFW3pEo/6tCCxp74OQr5T3L5XyQu+xMk4miWADW5uo 1Lq9icRRPVXnyaOa1vpw9y8Zw57CN8Mirafl6iJQBM3Lv9HZNH6B21C5Mt2uKvKgLrrI SfmGqjGi8diZkn4quKzUQirQiWjVnKXWj6RgkLJET31xYnT19oWzGEUsTaNLwIPZXuF1 vOIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Dh7ccx3l7zhH3OHkNDvhHQT8sz2cpNNFXWdiKjKnWbI=; b=oOLWI6HzTgxGT/KGY90z83gU5QlU8KvSFGIQrQg1nqxOY7ryDLwvpuruo3RK08gs9A DASZuc6A72EFaa430T1mMd4lNuba9GEk1FqHmX2MS0e8EFM8OSxWUYZ1DHsXAlVlrnQV Wc7LfxNU0I/rZGTnK2imtzAgKSUKiVf2P9BUms005+Hwfh4Pwzosybmvfbd+iVU2Ac1W jaKK39t2sn9qVa7s8hl129YbkQfl/fX+FqtIQ+GlDgQuyo/chYqLLdHURI3YpC5W6Bj1 T6AcMYzQY7vZaJDTSVkSF6QUzEOo0A7xQ+1iQne2Mpp+gyyPZMTNvLpbymvcps4nmpVW 1EVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si13884285ejb.714.2021.05.09.20.16.28; Sun, 09 May 2021 20:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbhEJDRc (ORCPT + 17 others); Sun, 9 May 2021 23:17:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2732 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbhEJDRb (ORCPT ); Sun, 9 May 2021 23:17:31 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FdmMk35wCzqTmS; Mon, 10 May 2021 11:13:06 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 10 May 2021 11:16:17 +0800 From: Zhen Lei To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Anton Ivanov , linux-arm-msm , dri-devel , freedreno , linux-kernel CC: Zhen Lei Subject: [PATCH v2 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init() Date: Mon, 10 May 2021 11:16:06 +0800 Message-ID: <20210510031606.3112-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210510031606.3112-1-thunder.leizhen@huawei.com> References: <20210510031606.3112-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The error code returned by platform_get_irq() is stored in 'irq', it's forgotten to be copied to 'ret' before being returned. As a result, the value 0 of 'ret' is returned incorrectly. After the above fix is completed, initializing the local variable 'ret' to 0 is no longer needed, remove it. In addition, when dpu_mdss_init() is successfully returned, the value of 'ret' is always 0. Therefore, replace "return ret" with "return 0" to make the code clearer. Fixes: 070e64dc1bbc ("drm/msm/dpu: Convert to a chained irq chip") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.26.0.106.g9fadedd Reviewed-by: Dmitry Baryshkov diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c index 06b56fec04e047a..6b0a7bc87eb75b8 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c @@ -225,7 +225,7 @@ int dpu_mdss_init(struct drm_device *dev) struct msm_drm_private *priv = dev->dev_private; struct dpu_mdss *dpu_mdss; struct dss_module_power *mp; - int ret = 0; + int ret; int irq; dpu_mdss = devm_kzalloc(dev->dev, sizeof(*dpu_mdss), GFP_KERNEL); @@ -253,8 +253,10 @@ int dpu_mdss_init(struct drm_device *dev) goto irq_domain_error; irq = platform_get_irq(pdev, 0); - if (irq < 0) + if (irq < 0) { + ret = irq; goto irq_error; + } irq_set_chained_handler_and_data(irq, dpu_mdss_irq, dpu_mdss); @@ -263,7 +265,7 @@ int dpu_mdss_init(struct drm_device *dev) pm_runtime_enable(dev->dev); - return ret; + return 0; irq_error: _dpu_mdss_irq_domain_fini(dpu_mdss);