From patchwork Mon May 10 06:38:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 433046 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2568533jao; Sun, 9 May 2021 23:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz/gzLRNsYnk6RrlTKT9BKM0f7PPAD9dDMuRnL+22glY7nLz20osO3Qbwj6BHAvzPwJlvl X-Received: by 2002:a5d:8ad2:: with SMTP id e18mr16912125iot.51.1620628718026; Sun, 09 May 2021 23:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620628718; cv=none; d=google.com; s=arc-20160816; b=jGC7ZPQ8SRefboRZ4cRyGPt18qDPNitzGd4uc5FXIXm6kesMqQmfHhBYQ1cx/eJSPR FWPyOVWWlrUr0kc8Zwv5XC5P9y5+O7/1D5YsJIrvTrzx98TrcxzyH+z7BK82WFUJMiqr lCabMkfSSq+oUDFvkdW4eBL6aV91Rg9uLbdPjuhwd2N/pnfxoE2CNZeEGOsqmcKodzFb UOzt4ddNiqSQ4+Gla4iYhKUJ6SeZTUj23Dafn/EreQCrSmKkENhjsJqQF6T2UvzPxKJ9 I+xxEG//EKu+aUhxG93IV5BDXBL3oBrrZwfzoY+VpHaj8/4Dc6ssdW9lj+ET+V0SXARh 3BXw== 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=Kmgj2stscAfI3hzaBZAUstp6ocrEdKQYGAX2Qzn77HSsiz1QP6iuNxuit57ZzlNAKc AsXTkzFK1/aFOCyRzBSCaBCbbOpMTaS/GjZDnYzq0JNdH9xH0a7sX5tyNyMvNnDCDAG9 hcXUwgijm9guEBrWAr7/0Jpdy0dmHiAFvj6VkGa15gGUVe+5TvYtNSsWudwkgNgYvrCs gKr+rAYj64t5yuEJLvMLOK29aj0kMLwJ6xK2Ji5IPtd9WOxNexE6HCDeuJavyxoD2KcY xlzGNJF9s7LlGOe/yErlwWA1hotlAYpK+Bf2bQMz1rUNELUm/+RGP6vCHM2yyc8gfw7o FfNw== 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 h25si13594046jam.40.2021.05.09.23.38.37; Sun, 09 May 2021 23:38:38 -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 S230116AbhEJGjk (ORCPT + 17 others); Mon, 10 May 2021 02:39:40 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2546 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbhEJGjk (ORCPT ); Mon, 10 May 2021 02:39:40 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fdrsl4mztzkYNj; Mon, 10 May 2021 14:35:55 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Mon, 10 May 2021 14:38:23 +0800 From: Zhen Lei To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Stephen Boyd , 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 14:38:05 +0800 Message-ID: <20210510063805.3262-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210510063805.3262-1-thunder.leizhen@huawei.com> References: <20210510063805.3262-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: Stephen Boyd 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);