From mboxrd@z Thu Jan 1 00:00:00 1970 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 DF968C77B75 for ; Tue, 9 May 2023 15:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235388AbjEIPmR (ORCPT ); Tue, 9 May 2023 11:42:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbjEIPmQ (ORCPT ); Tue, 9 May 2023 11:42:16 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F00F10CF for ; Tue, 9 May 2023 08:42:15 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-757942bd912so52544585a.2 for ; Tue, 09 May 2023 08:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683646934; x=1686238934; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=etyusjk1GXFs4nnYfd4cGeJfrsfR/4ZZW0m7Y3cJMhE=; b=gQvgx4yaxNxAJ4z6OnVdTFJD7nfmxqpFsrcSlJ+//USie9wQ4d+jFgdgb0oN/9Nklv 75C0QiRvyWBPLvCyVBh0jJHS1nVmgSjOyCGdQeUvzx65J7ZtRZVL2b+TUc0Tpp+CesG5 TgB51BGvVxMzEpfDA/UAYy8b8LglTKAKOGHhs+V0ftNypCy491RHWnLgLtqcnst2zlHv Jc76yXe08VJyLcp0XCogs7frY3nLbmnwwbw25KpABxQzyAkBwgfb6RPGv83SbNQeeC3t pRbkGxNtS2V89A0hXYX8eLhUFTbkDUQHksQ7zogoV1KwfD/1qbxwLqTTcskkj9lxpGvd h83g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683646934; x=1686238934; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=etyusjk1GXFs4nnYfd4cGeJfrsfR/4ZZW0m7Y3cJMhE=; b=OjGCytXzKEZAHEU8ZSCfq5XhJHvY7BJXO8/nBznmeHNU4n9c0xioSqus8tPuW5LoMz CiF/UGV+a3YNZFNU4Y0ewRZlVVA75CkRiiEkH37qLJCBM1lRqAiBkexjCAbmnipzRsam L8yV1AlafZtwfEjGNB9aDZ+CkLsPRY6RQigZ27iszXINf5W5jZC6p0ysBEbc4Vu6Bt5g /+5NVhVwtTAARD6oe/ajoVQ/imMRbC7g2d2PGFqXlSWn74Ts71SWydztxhh7W09pBygM pVgex9tlMnyXMb9JWsFPPAuSyczvlhdPzw7Mz0xTqvNrCX0sc4gHQXqMhbVKJjlZtr34 Qelw== X-Gm-Message-State: AC+VfDyUg0tUBWuj5S+Zr8W2+JhGhlJ1JJUooJRaTnEpCYc3iAUV3LHy T4MYD+kQfRki3LJYh1EdrZJB5HgRZtHp+wuAOq8= X-Google-Smtp-Source: ACHHUZ7m1Owh79aqBIldjLKAWVnO6vNex98FkCdiuazHdseDmML3KQFsOqWVhZ+cp2cTzitnRA9WyxgBEP4Zbt7CMqE= X-Received: by 2002:a05:6214:1cc4:b0:5c7:d03c:f2b2 with SMTP id g4-20020a0562141cc400b005c7d03cf2b2mr18822533qvd.28.1683646934468; Tue, 09 May 2023 08:42:14 -0700 (PDT) MIME-Version: 1.0 References: <20230508194555.1057007-1-shenwei.wang@nxp.com> In-Reply-To: From: Andy Shevchenko Date: Tue, 9 May 2023 18:41:38 +0300 Message-ID: Subject: Re: [EXT] Re: [PATCH 1/1] gpio: mxc: use platform_get_irq_optional() to avoid error message To: Shenwei Wang Cc: Linus Walleij , Bartosz Golaszewski , Greg Kroah-Hartman , Stephen Boyd , "Rafael J. Wysocki" , "linux-gpio@vger.kernel.org" , "imx@lists.linux.dev" , dl-linux-imx , Fugang Duan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, May 9, 2023 at 6:31=E2=80=AFPM Shenwei Wang = wrote: > > From: Andy Shevchenko > > Sent: Tuesday, May 9, 2023 4:12 AM > > On Mon, May 8, 2023 at 10:46=E2=80=AFPM Shenwei Wang > > wrote: ... > > > if (irq_count > 1) { > > > - port->irq_high =3D platform_get_irq(pdev, 1); > > > + port->irq_high =3D platform_get_irq_optional(pdev, 1)= ; > > > if (port->irq_high < 0) > > > port->irq_high =3D 0; > > > > I would rather do > > > > err =3D platform_get_irq_optional(pdev, 1); > > if (err >=3D 0) > > Should be "if (err > 0)", right? As the platform_get_irq_optional() retur= n non-zero > IRQ number on success. Either way will work, but your proposal is better. > > port->irq_high =3D err; > > > > > } > > > > And looking into the code the above piece makes more sense after asking= for > > the first (mandatory) IRQ. --=20 With Best Regards, Andy Shevchenko