Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp765603ioo; Thu, 26 May 2022 14:26:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1j6+2+K56t0+w+KivwXge+q3IDofQJsrzXyTGehTc8NME+IOShjpQVCmSBhawytqXnktK X-Received: by 2002:a17:907:2ce6:b0:6f4:7e8e:af40 with SMTP id hz6-20020a1709072ce600b006f47e8eaf40mr34620757ejc.211.1653600386242; Thu, 26 May 2022 14:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653600386; cv=none; d=google.com; s=arc-20160816; b=p1fUSzP7/ax3rHLxo42cxjQ96JFjUnU6AIt3095GwOiWIyXxOOV706i8VuO7+qWFWj 2HpgLleCE+/wWkq4jX01UqxOYS0MMv70B+OYH0s4DBUxVv8lyejbyIF/cPVUOLeUo1wg Ifn199aCC4Yp/N81IR7HDQwvyoHik+q7HB289/MvwgzwoQNSnfE1wRKYrNHExtITCeWW IJ9XEQCExwIK+vdVe/7CSVWaOPjtLfCF/WhS6BHk0kuSS40OttN1o9i8TI69yRbs4Sz7 n1dVDmGt7VUY4hreWkhPqvQBmdcefQ1s3uimAqt0ib55hiSSNFmNnXwof3h6uLTcwOs3 jVFg== 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:cc:to:from; bh=ab1v/HrtBOceQThMsmnujdRL+0p9AjV7ujmxCvMM6/g=; b=DTPovJ5SIJpdb49XhNIBMvb0rZ9a3BW3P4/bW5rhLs6ehApszTmJH56mCRTLRJBXyM LoY6f5/YT2u8LuHzOfCA05vBOzaaUvyns+jbqmS3SH9MURKn9HY3MqV43a1N6nP1n8gT mz5VJnWqq2jKw2cSfji/mF85GTtNVojMyPINjc6r14AgFjCDEoXWwtYcxQnmVP2I5Yqw HlRWolLX5rz0OMK8f8JJdz+tA1yf7rtbp0A9dumDKpXIPAxUoZj5ADSBA0skK4XGZSnO 5l9vkjWhXcBXaPKDsvAjxX362aOpzTlYyLZgyP77B9iy65CbcITpk0MfYQEnTer3RkPr fpwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt20-20020a170907729400b006f3ce72ceb7si2890504ejc.531.2022.05.26.14.25.58; Thu, 26 May 2022 14:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345511AbiEZBO6 (ORCPT + 99 others); Wed, 25 May 2022 21:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344150AbiEZBO4 (ORCPT ); Wed, 25 May 2022 21:14:56 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2723690CFD for ; Wed, 25 May 2022 18:14:56 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L7qgl0g17z1JC4q; Thu, 26 May 2022 09:13:23 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 26 May 2022 09:14:53 +0800 From: Zheng Yongjun To: CC: Subject: [PATCH] mfd: ipaq-micro: Fix IRQ check in micro_probe Date: Thu, 26 May 2022 01:09:54 +0000 Message-ID: <20220526010954.32288-1-zhengyongjun3@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: dcc21cc09e3c2 ("mfd: Add driver for Atmel Microcontroller on iPaq h3xxx") Signed-off-by: Zheng Yongjun --- drivers/mfd/ipaq-micro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c index e92eeeb67a98..ac042bfd38a8 100644 --- a/drivers/mfd/ipaq-micro.c +++ b/drivers/mfd/ipaq-micro.c @@ -403,8 +403,8 @@ static int __init micro_probe(struct platform_device *pdev) micro_reset_comm(micro); irq = platform_get_irq(pdev, 0); - if (!irq) - return -EINVAL; + if (irq < 0) + return irq; ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr, IRQF_SHARED, "ipaq-micro", micro); -- 2.17.1