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 7697DEB64DC for ; Thu, 29 Jun 2023 13:40:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231777AbjF2NkC (ORCPT ); Thu, 29 Jun 2023 09:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjF2Nj6 (ORCPT ); Thu, 29 Jun 2023 09:39:58 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48BF9E72 for ; Thu, 29 Jun 2023 06:39:57 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-51d7e8dd118so835957a12.1 for ; Thu, 29 Jun 2023 06:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688045996; x=1690637996; 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=mAb2qc50QSgKTFPb8asa69yU5CajCxT0KNO3XuPxDPY=; b=seMchDwOJbqHygqfbhjvgY6zDaScUTNRxVMu/9mAyvW6b42bFIcLzIXNyo9+eKrY3X rkQGc3UjZVrSYJZp5UkuECuFdz3uFxnBD4wjYAMk+l9XvT9PnltDdWb3es1ZCXie0VSW g2+wneFn8BnS4Oc86rxaCZ0B2zJqcyS0Wiv0HXZgMHG6QIGCyUMjYPESK6RMISeZ9YDk gQqTgqolkqBBUJMnNoqvqD8Y/tYTb0mNPLq2uD1z2e6sT8ZX8fdCSSDbVvh8mMUANtfU I2AV3BG7HTp8uceA2okpB3Y7rQCdD4Q1Xcnsm9/VmA/0W78YFrvj8ZQ8/022thh3AJ61 /n3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688045996; x=1690637996; 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=mAb2qc50QSgKTFPb8asa69yU5CajCxT0KNO3XuPxDPY=; b=CvANBcAqDPCz4BEfMq/woEtRzdYQd7aRLg9dlssDGGDSC+u28/gZnuUG82uBAsAzo5 SFK/3WMOi4l+cGe4MpgSJ/sCbjdgMtBNtR5LzgbBZrEMBxoZlBCW5Lt+sAUa1GE0u/8S rpw6w2P/yupJ9OHtqN/u1ddM6ujZdgGNZUvx0PKXg6HnwNdS6RCcdM90K8b/z1PBNqpe 67HdoMMwKRdERhsX/FhlJKLGaT9CQL9e8tGFYFyWuUO53gflwhlXJGd7Kn8jhIItTZq1 4Medchd+h6ZAO+R0u++Ap2g9wxQg175gzASswxGwaMuVejlBLyVtESUBb0+WdHRNwUE8 Y8Ug== X-Gm-Message-State: AC+VfDxdv4hQLKIoFNLfQgMJith8SCzP+4y/+Qg4Yagjvio8wj77tkph qOKefGV69RKRhg5gBqgNKtsyIMteotHnMdS8+I8= X-Google-Smtp-Source: ACHHUZ7Zj8Vnh7WhSL4aUXhu0xe2otoicHEWjsgVsRQOzZnvhOpEpPHM8lQKplyxt2S8tbGSxmePSXxGrO5G6+5o3Dw= X-Received: by 2002:a05:6402:1206:b0:51d:8a12:d267 with SMTP id c6-20020a056402120600b0051d8a12d267mr10404875edw.3.1688045995567; Thu, 29 Jun 2023 06:39:55 -0700 (PDT) MIME-Version: 1.0 References: <20230424123522.18302-1-nikita.shubin@maquefel.me> <20230601053546.9574-10-nikita.shubin@maquefel.me> <35bc18b2e685e8596b1fdc1a2e6212dc98725cd4.camel@maquefel.me> In-Reply-To: From: Andy Shevchenko Date: Thu, 29 Jun 2023 16:39:19 +0300 Message-ID: Subject: Re: [PATCH v1 09/43] clocksource: ep93xx: Add driver for Cirrus Logic EP93xx To: Nikita Shubin Cc: Alexander Sverdlin , Arnd Bergmann , Linus Walleij , Daniel Lezcano , Thomas Gleixner , Michael Peters , Kris Bahnsen , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 29, 2023 at 4:10=E2=80=AFPM Nikita Shubin wrote: > On Wed, 2023-06-21 at 11:28 +0300, Andy Shevchenko wrote: > > On Wed, Jun 21, 2023 at 11:22=E2=80=AFAM Nikita Shubin > > wrote: ... > > > > > + irq =3D irq_of_parse_and_map(np, 0); > > > > > + if (irq <=3D 0) { > > > > > + pr_err("ERROR: invalid interrupt number\n"); > > > > > + ret =3D -EINVAL; > > > > > > > > Shadowed error in case of negative returned code. Why? > > > > > > Majority of clocksource drivers shadow it. Same like above. > > > > It doesn't mean they are correct or using brand new APIs. > > Or may be this because irq_of_parse_and_map can return zero as error, > and returning zero from timer_init means success ? > > Please correct me if i am wrong here. 0 means no mapped IRQ. > > Can you use fwnode_irq_get() instead? > > Will it help ? Yes, definitely, in two aspects: 1/ it makes code less OF-dependent (helps also OF people to clean up the spread of OF headers and APIs where they are not needed); 2/ it takes care about proper error codes. --=20 With Best Regards, Andy Shevchenko