Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp464437pxb; Wed, 20 Jan 2021 11:17:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGuUxPQ8oQTpzlwQjC5A2HPt7DRtORKPn08pHB2v/VuHc2kikX4j2X2tvZNH/f5cUF2mVr X-Received: by 2002:a17:906:c9cc:: with SMTP id hk12mr5145727ejb.134.1611170270584; Wed, 20 Jan 2021 11:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611170270; cv=none; d=google.com; s=arc-20160816; b=aGgemHDmklnkRCw0cWwGkAvpTv61pL8ZOwjUXtXPRM5tk6FGC+EVWqZopM6DM08ClS +O8OZ3vnae6f4RZCJi8b7oakrdKoa9Isisc8RaoPHXTk4g5J2FJtU+UNlOnaE+mCkNZo /cy2kawWLJSzACW63q/7RQap2A3zFoj3T3D9gOe9hZm577hsfeGkzGSuiAI/PZQyBAPL BaBJhpFrB1HltAyv+0RA77oOi8THu2qLGU7N85/6KQZKOECN+nz3JcRXi1CGhWcVyeZv 5jdFBmcIFCnPoTsR4CPkmSR45MTfbquGZUyd5f269PgeItobBM1ftqpM8Lbxi1PlYgrt yXhQ== 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=8Hs2DcL35t0kl1yCFHjjFssW9wT5FyIR7wKEzzsdbpo=; b=CbQhkRdxwVCEi90gWId2c/taafuI0C5yxJAuzDi/+yvKjpEXc97a0p8xhifVob4hxT B2EeeCrfr33u1ffbXrUH0zuZHwVvpwWgWjgvy5u4za0WKsFtZ5frKUV6K5Q7R72+zTxa Oh3wA2rhrka/gZTlUQAVUGSGWksgcG5gtYsq8LPBQQYbIcPY5rKb3WNw+mwrgNcJlrNA g1N0VFP422ARV4NEw7l30+UrITvHTAQWPFd4y1TMwt8aGEpnWf7UXNCnWKmspUlG+6dW CxPFzp/tR37nBY5j4J3rTiMcRTG+l/HtUiIez328cJOcLI3ATpi5OokoXVDPrBI9cyoU zPYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dRav0sux; 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 r17si1232434eds.518.2021.01.20.11.17.25; Wed, 20 Jan 2021 11:17:50 -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=20161025 header.b=dRav0sux; 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 S2388052AbhATTQq (ORCPT + 99 others); Wed, 20 Jan 2021 14:16:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392251AbhATSvy (ORCPT ); Wed, 20 Jan 2021 13:51:54 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB99C061575; Wed, 20 Jan 2021 10:51:13 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id x20so2766122pjh.3; Wed, 20 Jan 2021 10:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Hs2DcL35t0kl1yCFHjjFssW9wT5FyIR7wKEzzsdbpo=; b=dRav0suxujHDPp6A8CK2JWKAEtKakYb5QGn9YEZzwzGCtYrYK14SCri4gnR5bxb+Us lGUMCX39l82e11zEbX5HZOfIXR715YY8bU84qeW0W9tmRDo2fT36BlvGcsZry0L3ZPBz H4mlxJ0cKy97A6D2uqaBkhs0t4ujUmNSbDvXRAq/VCVNWZtC+tc5lS8ROvv/AW/ZW5Y2 U4nVx2BBEcO4UBbPiSaPA/DX6cb7UWpZEtVfghF8oqMRhWlmF4C3xdwOjc/snLriUl7X rrugv/vNvJGyOnM6ZxNhGyWOLtguohjdDIRgkQY3Vd83pX81q+UP3VjPY9k4wjNCQCoP NNhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Hs2DcL35t0kl1yCFHjjFssW9wT5FyIR7wKEzzsdbpo=; b=TaBDbpB7dJx4r5B7Iq4+h67SXokBvbm8DiECJSqWo4cJPz9+ksybw5qHNi8R3btaIn hoX6WX8WJXyc9boPAglN01IoIwOiV8RfX1WqEgps0I4d9lHB+sEsoF/O4b1SSDWBHiTr FDNDSOcLACdYpdMBJt5dJVw5hPMPAuW6ZkJkWmytZ/Ic6hqkxb8N3N7TbLUeB6bMMBhq 5a57E6UAldL0MGuWpspVzX4b+50ZXRKLRqzwGttUj5ewgVxviFVDKGpRyynnle15QnfZ XjG9o+LQvouiXVtQ/s+GAADt/EWzHwGc6kx+UuuV8R2T5cHcP0zbfZaeHid1QF+khyRT AuKA== X-Gm-Message-State: AOAM530nOjNIV2a9G9Pp6pSlUIDZfvLyLIlhcztA2CT+/qFIK1DH2X/9 hXYycWh3mK+6KtGj3riU931MXC2h1xmePtVVdqQ= X-Received: by 2002:a17:90a:1050:: with SMTP id y16mr7368838pjd.181.1611168673398; Wed, 20 Jan 2021 10:51:13 -0800 (PST) MIME-Version: 1.0 References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> <20210112134054.342-10-calvin.johnson@oss.nxp.com> <20210112180343.GI4077@smile.fi.intel.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 20 Jan 2021 20:52:02 +0200 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: "Rafael J. Wysocki" Cc: Saravana Kannan , Calvin Johnson , Grant Likely , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Diana Madalina Craciun , LKML , netdev , Laurentiu Tudor , ACPI Devel Maling List , "linux.cj" , linux-arm-kernel , Bartosz Golaszewski , Greg Kroah-Hartman , Laurent Pinchart , Randy Dunlap Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 8:18 PM Rafael J. Wysocki wrote: > On Tue, Jan 12, 2021 at 7:02 PM Andy Shevchenko > wrote: > > On Tue, Jan 12, 2021 at 09:30:31AM -0800, Saravana Kannan wrote: > > > On Tue, Jan 12, 2021 at 5:42 AM Calvin Johnson > > > wrote: ... > > > > + ret = fwnode_property_read_u32(fwnode, "reg", id); > > > > + if (!(ret && is_acpi_node(fwnode))) > > > > + return ret; > > > > + > > > > +#ifdef CONFIG_ACPI > > > > + status = acpi_evaluate_integer(ACPI_HANDLE_FWNODE(fwnode), > > > > + METHOD_NAME__ADR, NULL, &adr); > > > > + if (ACPI_FAILURE(status)) > > > > + return -EINVAL; > > > > + *id = (u32)adr; > > > > +#endif > > > > + return 0; > > > Also ACPI and DT > > > aren't mutually exclusive if I'm not mistaken. > > > > That's why we try 'reg' property for both cases first. > > > > is_acpi_fwnode() conditional is that what I don't like though. > > I'm not sure what you mean here, care to elaborate? I meant is_acpi_node(fwnode) in the conditional. I think it's redundant and we can simple do something like this: if (ret) { #ifdef ACPI ... #else return ret; #endif } return 0; -- With Best Regards, Andy Shevchenko