From patchwork Fri Apr 29 16:49:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 567719 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03385C433EF for ; Fri, 29 Apr 2022 16:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379299AbiD2Qxs (ORCPT ); Fri, 29 Apr 2022 12:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379300AbiD2Qxn (ORCPT ); Fri, 29 Apr 2022 12:53:43 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E03AB85A for ; Fri, 29 Apr 2022 09:50:24 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id i5so11508393wrc.13 for ; Fri, 29 Apr 2022 09:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hR+ipPq2gap4bXepi4EzWC/gfjexmZUBGu30czl6wWU=; b=vaItMW+1gyLuD6nhgipRjoSdUBqBq1APnbecLpaCBuq9hU/b9Ir0ZoimHT8smyU7qh wGrNrckEtlos5Fp6ugNuUsP0qrUwso3UoN5DODnpxSoylbN//uXifD8PThUirbJvmNKB 8Lxmn0pX3jb98je+cnJozRPkTvr19ia4C1N3CWcEiSHjPp6RcuOhpILSetKfW3krfT+b s8BddRpIT6rWEIfSPhWjN9o9BRIIhIOm46mn37L31KBCqajlJlwRpjuifNwEIeVaL8/e LMuhj/RHTMN3o3FmRI95pVr44xspL4GO3cq7q/XrXQWB6hzpFBOSaRkb12striwDmzMP 2I/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hR+ipPq2gap4bXepi4EzWC/gfjexmZUBGu30czl6wWU=; b=M2GUeHdRo72sTQjKSLKWlhhzTI20STukRenRYewhEArC7VJiucmx9ZJh6W4ZT/aUkn B0SWiskBqK0oQQFsl3UsGTFfY2DqxHX/8dMXcN8p/NQBdZxgvsDJqTsc4eTo6EjgKIBf 6uZimnewX89uhJnoK1PZ+rWLrrzs0KZjgxya61XW33+e6vTvSAypNv49i9jWLjLeZ6dq h13qIeK4l+3ZmAT8CfZrwBpTkNhqITdk+LUgXeoCGIHBdMJGofQ98pRoGYHtNK0ER1ah SAVNmkBeYGss0kdTfiIyaYydCxgJ3K6WM3ZQz+QKl9kLs60n2qEz3xRyPDGF3PRw8+nP 0pjg== X-Gm-Message-State: AOAM531b4hqnbuLWYyDtvQldSJB6hEM3vFGOVzJG335rdhxCTJ2kOF3a ESvYv69ZAxejYC+QciyBlA9b2g== X-Google-Smtp-Source: ABdhPJyIo9jrETp7GhL4hPuJ3ZBGxPtVsk20rwc3r57n+zFu7eQ798UJGZjnHlP7ppITNRBXF+eo5Q== X-Received: by 2002:a5d:4a84:0:b0:20c:47b6:61ee with SMTP id o4-20020a5d4a84000000b0020c47b661eemr51638wrq.68.1651251022697; Fri, 29 Apr 2022 09:50:22 -0700 (PDT) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id f1-20020a1c6a01000000b0038c9f6a3634sm6846906wmc.7.2022.04.29.09.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 09:50:22 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Miaoqian Lin , stable@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 1/1] slimbus: qcom: Fix IRQ check in qcom_slim_probe Date: Fri, 29 Apr 2022 17:49:17 +0100 Message-Id: <20220429164917.5202-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220429164917.5202-1-srinivas.kandagatla@linaro.org> References: <20220429164917.5202-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Miaoqian Lin platform_get_irq() returns non-zero IRQ number on success, negative error number on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Cc: stable@vger.kernel.org Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver") Signed-off-by: Miaoqian Lin Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/qcom-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c index f04b961b96cd..ec58091fc948 100644 --- a/drivers/slimbus/qcom-ctrl.c +++ b/drivers/slimbus/qcom-ctrl.c @@ -510,9 +510,9 @@ static int qcom_slim_probe(struct platform_device *pdev) } ctrl->irq = platform_get_irq(pdev, 0); - if (!ctrl->irq) { + if (ctrl->irq < 0) { dev_err(&pdev->dev, "no slimbus IRQ\n"); - return -ENODEV; + return ctrl->irq; } sctrl = &ctrl->ctrl;