Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1781254pxk; Fri, 2 Oct 2020 20:30:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzRZIWi+0pwRatenLDBgYgUOsSW5zA3YPNJJ1h6suTQFwg6UCu3Nkom2Mz76nvITsf5auC X-Received: by 2002:a17:906:ca90:: with SMTP id js16mr5208513ejb.533.1601695815705; Fri, 02 Oct 2020 20:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601695815; cv=none; d=google.com; s=arc-20160816; b=aCIrOie09pKihz1zyrqnzruMcWhQpuRy2HkijoD549lNyjPzedUcU/IUzxrLj7TXHv UsQJr0h92lhh6S3SZq0AcFfhpBIX1W6WHNfU3GpHtwrWHyHrxXQqH2J9DrfS0tSsKhRz MzFWptLaETl8kDt6Cle3FIdM9QHssbqNdR18PzrjTydYc9MCEi0lKhYYuUxlQaJcyzo8 sFcSy2QiDPy9YjfYbHfwDEf/RVaxGl12lQ/jajxDbvGeKprKGx0Sc0LETAywpjILYdMX xJyAfg/eB4CW0syGUfikfkM4msmr5rDvAsCV/S0TqbCdjzXOTeBrYS5IgCIhkQOk7iAy NaFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=e2k9kjDv2p9eTNWC0EVCOFgsB5nYiFaNdVYXIL/p6yA=; b=IqLGC0s2myMPScTjFc5tsHD+5Ko5QMq5ra0whSc8mDXSexme95KnCb4hySoS5SulDn jBny+MbMigvutloC/CLtgwtEUdNU9EAxaP9FlFaEdhPCwqRQML1xs3Z0pnItzGB26/Td L+AYn6VOQS+ZrHxEK6IKPiQkSfYvImLHf1+OBSr1PL/SEyJqOI9Yk9t7J3/WCPsd2tBA gWmkKeBY0yLI13K61HR0Wmll/vPpriy0oYQQb0CSd/mT07emeVB8Jvtg34MKF769M93A F1LUBHNazgN6YGu8cQHl2zNwF595giLCctlixTp/anNTWL6T0NyfJlt4QqufilK0ZSg5 1GnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JYzuV6Al; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq28si2396363edb.474.2020.10.02.20.29.53; Fri, 02 Oct 2020 20:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JYzuV6Al; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725826AbgJCD0S (ORCPT + 99 others); Fri, 2 Oct 2020 23:26:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbgJCD0S (ORCPT ); Fri, 2 Oct 2020 23:26:18 -0400 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47F7A20719 for ; Sat, 3 Oct 2020 03:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601695577; bh=CBE60R04Ssh2X4r5oUkkDdZCifZI6pr2boyjVftGq04=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JYzuV6AlipFT9jR0QccHNBWhs+sWE/CY4+1YHGm7YJQy2byk5AdKePh9hbM7BKIcL LADPIBysqb2spD9KAib5bcNy0WE5/M8TeeJssN17ryj3IRqT/BwilY6iUdl/aStxY/ BxsjjhPhX/t/cjHRDe7YLp1TD1VxFdxqyfSwvVFU= Received: by mail-ej1-f51.google.com with SMTP id a3so4417712ejy.11 for ; Fri, 02 Oct 2020 20:26:17 -0700 (PDT) X-Gm-Message-State: AOAM53185vHURyHLyEUMbZZUMLXXo/uVUoE1B8FbYsN3uBHi7wVUZzl2 AaA2BM/rikIBi7BcJDd8zDDcFAqR/oEb7qGTZA== X-Received: by 2002:a17:906:158f:: with SMTP id k15mr187553ejd.310.1601695575882; Fri, 02 Oct 2020 20:26:15 -0700 (PDT) MIME-Version: 1.0 References: <20200827182507.4938-1-krzk@kernel.org> In-Reply-To: <20200827182507.4938-1-krzk@kernel.org> From: Chun-Kuang Hu Date: Sat, 3 Oct 2020 11:26:05 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] mailbox: mediatek: Fix handling of platform_get_irq() error To: Krzysztof Kozlowski Cc: Jassi Brar , Matthias Brugger , CK Hu , HS Liao , Houlong Wei , linux-kernel , Linux ARM , "moderated list:ARM/Mediatek SoC support" , Frank Wunderlich Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Krzysztof Kozlowski =E6=96=BC 2020=E5=B9=B48=E6=9C=8828= =E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8A=E5=8D=882:25=E5=AF=AB=E9=81=93=EF=BC= =9A > > platform_get_irq() returns -ERRNO on error. In such case casting to u32 > and comparing to 0 would pass the check. > Reviewed-by: Chun-Kuang Hu > Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver") > Signed-off-by: Krzysztof Kozlowski > > --- > > Changes since v2: > 1. Fix subject. > > Changes since v1: > 1. Correct u32->int, > 2. Fix left-over '!'. > --- > drivers/mailbox/mtk-cmdq-mailbox.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmd= q-mailbox.c > index 484d4438cd83..5665b6ea8119 100644 > --- a/drivers/mailbox/mtk-cmdq-mailbox.c > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c > @@ -69,7 +69,7 @@ struct cmdq_task { > struct cmdq { > struct mbox_controller mbox; > void __iomem *base; > - u32 irq; > + int irq; > u32 thread_nr; > u32 irq_mask; > struct cmdq_thread *thread; > @@ -525,10 +525,8 @@ static int cmdq_probe(struct platform_device *pdev) > } > > cmdq->irq =3D platform_get_irq(pdev, 0); > - if (!cmdq->irq) { > - dev_err(dev, "failed to get irq\n"); > - return -EINVAL; > - } > + if (cmdq->irq < 0) > + return cmdq->irq; > > plat_data =3D (struct gce_plat *)of_device_get_match_data(dev); > if (!plat_data) { > -- > 2.17.1 > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek