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 D9460EB64DD for ; Thu, 29 Jun 2023 13:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231831AbjF2NKy (ORCPT ); Thu, 29 Jun 2023 09:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbjF2NKl (ORCPT ); Thu, 29 Jun 2023 09:10:41 -0400 Received: from forward501c.mail.yandex.net (forward501c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d501]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 802AC2D60 for ; Thu, 29 Jun 2023 06:10:37 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:a497:0:640:fcbf:0]) by forward501c.mail.yandex.net (Yandex) with ESMTP id 5AA8C5F186; Thu, 29 Jun 2023 16:10:34 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id WANpoa3WqW20-RlclWTAv; Thu, 29 Jun 2023 16:10:33 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1688044233; bh=if8XJsQm2fMxTwCzbVNbyTJKRzaYnPHv/zYS+5MnX44=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=Y3z7XniSE24LqosSp/6ckbvUicVly6zS+/ky6FHmuP9a1dzx2n4fCNmGj0klWJGHT 7VUahasxmSN132C+3EofvB3xp4Tvne/CLfLXTCkoF22Zq265Us9vTru4D4UKWkYMkO RFXxEfKLmtJz8ZHlTi1wgSeLjOcBnMIKDqUUdwuQ= Authentication-Results: mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net; dkim=pass header.i=@maquefel.me Message-ID: Subject: Re: [PATCH v1 09/43] clocksource: ep93xx: Add driver for Cirrus Logic EP93xx From: Nikita Shubin To: Andy Shevchenko Cc: Alexander Sverdlin , Arnd Bergmann , Linus Walleij , Daniel Lezcano , Thomas Gleixner , Michael Peters , Kris Bahnsen , linux-kernel@vger.kernel.org Date: Thu, 29 Jun 2023 19:10:33 +0300 In-Reply-To: References: <20230424123522.18302-1-nikita.shubin@maquefel.me> <20230601053546.9574-10-nikita.shubin@maquefel.me> <35bc18b2e685e8596b1fdc1a2e6212dc98725cd4.camel@maquefel.me> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy! 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: >=20 > ... >=20 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 irq =3D irq_of_parse_and_map(= np, 0); > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (irq <=3D 0) { > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 pr_err("ERROR: invalid interrupt number\n"); > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ret =3D -EINVAL; > > >=20 > > > Shadowed error in case of negative returned code. Why? > >=20 > > Majority of clocksource drivers shadow it. Same like above. >=20 > 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.=20 >=20 > Can you use fwnode_irq_get() instead? Will it help ? >From docs: * Return: Linux IRQ number on success. Other values are determined * according to acpi_irq_get() or of_irq_get() operation. * of_irq_get() * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure > The shadowing is most likely due to nasty =3D0 comparison. Indeed. >=20 > Also that ERROR is a bit weird, pr_err() is already on error level. >=20 Completely agree.