Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1247222pxb; Fri, 21 Jan 2022 13:17:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGcoTkHQgMpPBNcmJ6z7EM3B8cd+rnRjHJrxUkCc7n86Xjdf8X30RU+fHYWbfUd5kCeev5 X-Received: by 2002:a63:45:: with SMTP id 66mr4178227pga.607.1642799823899; Fri, 21 Jan 2022 13:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642799823; cv=none; d=google.com; s=arc-20160816; b=jRGrfmNJ324SgZb4HaDRmmCSEd3Wne7OnJXrBYuilWBLu3xgUP64KJfceZpYPJpe4C D+55M6xjNBWGYY3v3tLdxL+nepGgcwzLG3XoJLzaLl6cti9UiwKszpPIyKWl26zY7PsK UKcQUjXWEq53Je56+o5g1Gmj8ajSLbAhfgEJiVfKoOIES5fqyyYEztgv7KSZggsIbENI ezcdtMFENCJFLszDZ7Bd0B9U0XGiUcNkfsF+oWHXe04J3c4sj8b0izlmYD4e5/60kOrl 7Qpo3X6qQ3LlI5btpebWKXXpzDN1mi5y9KyB1Xactgi7/OcbBnmK2IpxSbu20KfrxH6J zQrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cgZVphH15pXcRU+IK9WGFI43RQ+fr6aARtumaWFhszI=; b=tzPAX6kcuDJOGQVaYtNNQ8gfJTI0iVDx+36FbB6u7kqUqwh5/5X+ewCbp9zRc/Paph +p5aw4WVixzh5qqbxY95epleZu4e1pRD1cVdb3fW0/FqPkJVvkEPe7KLTcloU+2KXUX7 8Bm9VTUjpvTW2WMUBuEHS35UKDe3YrLn3CugW2MYsQRibxrC7FHNSFm/VOAmWzOy/SBT xBuzmI805MLsxF8wPmZIFjKv4RWU6K/EV3no3lE5ljuXblUBCVgHDNtLpzAt4uuCuYrm bLk2sPqEyuSbasKwCvT+FYVbIXnlQ7AMT/GXhhapgcXZH7loAC7jEwIUHmNUpIBUhyYs B0Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DnNny+5D; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si6785316plo.473.2022.01.21.13.16.51; Fri, 21 Jan 2022 13:17:03 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DnNny+5D; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359777AbiATKNl (ORCPT + 99 others); Thu, 20 Jan 2022 05:13:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232747AbiATKNg (ORCPT ); Thu, 20 Jan 2022 05:13:36 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEEDC061574; Thu, 20 Jan 2022 02:13:36 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id cx27so26627992edb.1; Thu, 20 Jan 2022 02:13:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cgZVphH15pXcRU+IK9WGFI43RQ+fr6aARtumaWFhszI=; b=DnNny+5D9ETYIyv7o4p3JByOBnal59A4pTpYg+7FdW1Mr0v0mdHjQXCfNWOS7ziy1G tte3/qx6cQaGbQIJYzjMgpFrcCQMTqVFZeENgN4V3jqPKJmFW6FLK6PwxabouW6o4FFF iIdLw3YE4saO3iJkerHxQjRqLsXMwn5rE1+hFJz5GCv+Cy8jcEftWJlPVnOKegz91dGY x3ZIJ+F77UEEAS+hYNKoI2ascGZ0MbYM3ENN0aCwIU1LVuYHRw/RqfVkvT2kZcM3EUn5 Mo6PF0yY6IEWn37G6EqSKy3nkYCvHhxQ+Nu/ffMxJESvx3ejmlBkQpIlF1eO27ktukI+ dn7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cgZVphH15pXcRU+IK9WGFI43RQ+fr6aARtumaWFhszI=; b=lKDQwHKzQDzlzwv2M2eowQPA2PLBnEx9Kv+z+froVG5HdruLLpKGLxO3iruAWJd2If J5ETrL0nO31cTYMmu8nX9w45YmcaqZTBf1KD5nMMCMUtSU56Kgm7BNVpl9Ad8pBEY/CX +X6b+qPR7hLtOFrnriQ5PRboqFqnBwmMUFOYNkaZY4Qby/iz7FHvQSBCrXwZBKAjtr7x w2kaNefoBYplsZs8jjEl1shE+PNMjdKmflQuSjZeOUICry2VuXR7AlSG7GPziQCNCqEV xN2fglBET2oJyM/3V92CNOUN6ICKN9lGPDrmAJbMH+VHbMr081dlzH80EtVjGcyA98fD Z8Fw== X-Gm-Message-State: AOAM5337wysjjcLfMGrTON5wRh3CCzGZ+VjoE17Oqu9LebGj5KJcHfka S+YX1mag/uTFz/FmimKpJFsWXYUvPu5t1xUyht8= X-Received: by 2002:aa7:cf0e:: with SMTP id a14mr2409448edy.296.1642673614921; Thu, 20 Jan 2022 02:13:34 -0800 (PST) MIME-Version: 1.0 References: <1641996862-26960-1-git-send-email-akhilrajeev@nvidia.com> <1641996862-26960-4-git-send-email-akhilrajeev@nvidia.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 20 Jan 2022 12:12:58 +0200 Message-ID: Subject: Re: [PATCH v2 3/3] i2c: smbus: Use device_*() functions instead of of_*() To: Akhil R Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 20, 2022 at 11:48 AM Akhil R wrote: > > On Wed, Jan 12, 2022 at 4:15 PM Akhil R wrote: ... > > This change reveals potential issue: > > > > > - irq = of_irq_get_byname(adapter->dev.of_node, "smbus_alert"); > > > + irq = device_irq_get_byname(adapter->dev.parent, "smbus_alert"); > > > > > if (irq <= 0) > > > > I guess this '= 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 handled in > fwnode_irq_get(). If I understood it right, a return value of '0' should 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. -- With Best Regards, Andy Shevchenko