Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1262918pxb; Fri, 21 Jan 2022 13:44:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA2VCImY1i2FGaaumGTnBPH/5aF3X7oj1GMQJsCiWkkCTQXfKtJrLf3ySfcHpirj2WhjI6 X-Received: by 2002:a17:90a:8808:: with SMTP id s8mr2560388pjn.9.1642801495879; Fri, 21 Jan 2022 13:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642801495; cv=none; d=google.com; s=arc-20160816; b=DiS0jonmX0nXGVyPT55hkWirztEL9qUVo2KrkZPFD9khEE4CgzSdcqnYGUXkiUYrPU zbvIEtfZkKCpClIwx+WOijoL3iA8kelRJ+XTDImp70wIxIYJrhcptolHpZRMMv7uddKM +YUcANUcgheZHr8lFCSwbCFDoEoKqHSVIZ91SzNwsUH72Sw18NkGSuq+h3xilBe7T7zE /cX5+EpDjT9f6G8utLEAyvfLN+26YNnmX3bMSHwcAf5k246Bl3VPmEAznw+CYBtr0GHm Afx40Gdcsfys6iNTy+U8h39Ww4Jh+Pqf9CTFeq1hFXaD9A+0/5yPEEIfzU+jbj5wYbes 5sww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rCcVWi0uI4tyiS7NWcSjZYb0tGVqVouUwNMNcRrUfys=; b=zyI/KAN/tPun4pl6h4eXNr9+rfMJhc7l5nFMgOnx3WnAxRZYRd4Zc9OVms6kOkuo12 Bx24s1uvyLN7tnRQ1JxTZyJoBfJ0QLBfTQPMLnHUWXDqKYUE4sx/gLspAIFRCIugOZri wv19KXUcKjToOQx9zHaMg8e/jhjTeJKot5FImw8+bUhhodzbZidlQGcxBjl1L5Uo8lAr BiAFdla3gIz/oy5XSwaLJb250+G+k8iad/6AzJifpLkvcXp3sBBntDsPZHAAfBWTp5I5 s6XMRaGm6znM39vyayzQM6n3D3Ui2jHW4lvwG/tfMIrrSHOElXOzEhfqX1D8uiV9RleP qB+g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si3060799pfo.306.2022.01.21.13.44.44; Fri, 21 Jan 2022 13:44:55 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbiATLbM (ORCPT + 99 others); Thu, 20 Jan 2022 06:31:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbiATLbL (ORCPT ); Thu, 20 Jan 2022 06:31:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15B1C061574 for ; Thu, 20 Jan 2022 03:31:10 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAVeb-0003Ed-UQ; Thu, 20 Jan 2022 12:30:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nAVeZ-00BLYg-Sj; Thu, 20 Jan 2022 12:30:55 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nAVeY-000E9C-HJ; Thu, 20 Jan 2022 12:30:54 +0100 Date: Thu, 20 Jan 2022 12:30:54 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Andy Shevchenko Cc: Akhil R , Christian Koenig , Dmitry Osipenko , Greg Kroah-Hartman , Jonathan Hunter , Laxman Dewangan , linux-i2c , Linux Kernel Mailing List , linux-tegra , "Rafael J. Wysocki" , Sumit Semwal , Thierry Reding , Wolfram Sang , Len Brown , ACPI Devel Maling List Subject: Re: [PATCH v2 3/3] i2c: smbus: Use device_*() functions instead of of_*() Message-ID: <20220120113054.lmd5rmvmflaf7v7t@pengutronix.de> References: <1641996862-26960-1-git-send-email-akhilrajeev@nvidia.com> <1641996862-26960-4-git-send-email-akhilrajeev@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cdxvf7ymm4mv6sgi" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cdxvf7ymm4mv6sgi Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 20, 2022 at 12:43:02PM +0200, Andy Shevchenko wrote: > On Thu, Jan 20, 2022 at 12:29 PM Akhil R wrote: > > > > > ... > > > > > > > > This change reveals potential issue: > > > > > > > > > > > - irq =3D of_irq_get_byname(adapter->dev.of_node,= "smbus_alert"); > > > > > > + irq =3D device_irq_get_byname(adapter->dev.pare= nt, > > > "smbus_alert"); > > > > > > > > > > > if (irq <=3D 0) > > > > > > > > > > I guess this '=3D 0' part should be fixed first. > > > > > > > > '0' is a failure as per the documentation of of_irq_get_byname() as= well as > > > > of_irq_get(). The case is different for acpi_irq_get(), but it is h= andled in > > > > fwnode_irq_get(). If I understood it right, a return value of '0' s= hould be > > > > considered a failure here. > > > > > > Depends. I have no idea what the original code does here. But > > > returning an error or 0 from this function seems confusing to me. > > > > > The description in of_irq_get*() says - > > /* Return: Linux IRQ number on success, or 0 on the IRQ mapping failure= , or > > * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in= case > > * of any other failure. > > */ > > As I see from the code of fwnode_irq_get(), which is used in this case,= returns > > either the return value of of_irq_get() or error code from acpi_irq_get= () when > > it fails, or res.start if it didn't fail. I guess, any of these would n= ot be 0 unless > > there is an error. >=20 > of_irq_get*() seems inconsistent... >=20 > Uwe, what do you think? Yeah, this is something I stumbled over during the platform_get_irq*() discussion. But I don't feel like investing any more energy there. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --cdxvf7ymm4mv6sgi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmHpR+sACgkQwfwUeK3K 7AlVDQf/UyEbXUuWCywlD2V5dd6jAINm1Cg0yyuFPxHty9d7WFBu0iL+OmYwdKsf VNESVe1lcz+AUYaov33RaM0cMCqR2tZ+i3tnoyxBH80xIRTE0ncyW1zhg0pxkQnE vQZRkHAjVtz1DzmOKVP1FPCRqh0H9LmZXfaSJL7lhHDLe5WgAhzXszGDVY1J9xZi tlR1vB91vzTk/+TLVsj3l+NU5qbrhqx6Cqwktlnn00XX9QMkH5+FApDMC8NfZ9qI CMAh5RjiEBoZEKQY70Ix70kyVLAblmNkVY5rvbie9YoZ+fBMMpRNdykLgPqPUaBv kEdOP8qlPlbAKVs7MmUfMgtl+IVocg== =bB3r -----END PGP SIGNATURE----- --cdxvf7ymm4mv6sgi--