Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1324776ybt; Thu, 2 Jul 2020 02:36:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/Vp1XQFDnrtd4AB3YEEWvDb3VC3e3cVExTKkBC7XNPwnBjYgVlFzSdg4XryigJwe/tH2D X-Received: by 2002:a50:ee07:: with SMTP id g7mr18449892eds.320.1593682577569; Thu, 02 Jul 2020 02:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593682577; cv=none; d=google.com; s=arc-20160816; b=yysuQAb2Nvtouh7ZFineFBmz1Lkz1yO+HBT3OBTqa2VaMvyLzrY73rRLLFABOidMsg 7/d924m+Tl2o7qsfKJHkCMbwPb0b2oSk4M4/34SsYQ+XMdsgPUAwox3VUP1mTzUEEcy0 NgjU9dPrbJXCto/F2+Zgl3rdHUWYv0hbP2muGWd20aN4ygwTtYuJrdX1zjOG4H0psZPG UpapWCTNiYd44Br6Kx1rJv0RffXGybi/jlNCaHE0JtQLb89b/JcV50sYNrBNwPl/SFlN 8UfKLLuXYBRXYQNMYth6JAsV5cSYpGYSRvznSK4Jo2v5K9FoGg/HuP9LBClB5ZVn3Saf bttw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1MSOyhRxeOlZZV64ERgtop/oxnrPChw5nLGPyTva4Vo=; b=ElO7JBY1uhpxEUsphKc3Lp/+vKxSmjR3WHC/c/ZS0ZD6BBYohbUe7xUXnFCURMiwAF FWmat/Jv6OcIaNPY8dsjLOEM/rID5z28dc/FPYQql0aWeEk1VXDPYTfL14DbOq0K5DGX XS4OMx8tBfW2+Wdr+hhLTD2kcQp+UZy7UdU/8socxtFTeb9Ni2dFJlgEp2OLspMZrJr2 vowJJAyBIPyyoRjgBab638xQw0IPPP+gdedtqKsB4ipKHNoKFLrGaiuFJBRizA2LDye9 uZcY0ZNQLStKomOCX0Vp53V/tr4rWZ19qJYY+g1DNhFNOnMXxKRE4Vuk0OJ22fzOgY2w XWog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TVEnUSpK; 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 a24si5156565ejs.633.2020.07.02.02.35.54; Thu, 02 Jul 2020 02:36:17 -0700 (PDT) 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=TVEnUSpK; 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 S1728210AbgGBJfG (ORCPT + 99 others); Thu, 2 Jul 2020 05:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbgGBJfG (ORCPT ); Thu, 2 Jul 2020 05:35:06 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB95C08C5C1; Thu, 2 Jul 2020 02:35:05 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 67so8230319pfg.5; Thu, 02 Jul 2020 02:35:05 -0700 (PDT) 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=1MSOyhRxeOlZZV64ERgtop/oxnrPChw5nLGPyTva4Vo=; b=TVEnUSpK1abcjZ10U2QydBOOnzNT5Wgz11XhjEaZmJNpQo5VNiuwzY07xp477pR1mb h3WadbpIkM2HrXm8eTkP9nvzYDcoXLRPJLLaw8pFw0Sn9dRdDlU3SiauVqTK3uNg/4cs 8uVyrWW3EwKuPNxmCjxlVSzbxVKU+kq8AiqewqwiDuD8+JGVoIArG8tJRFogHNf0v0JL EfWSq+Rt7LshYeYoOmSWcFnz7fqddRiAzR9k+RvQDg0pYRkaDLfHRna+xW7CnZTfihhG lQ/1JIPrPdJX3hBNOxN8gNw3fv6bCnZIv+crKfssoIWD/e2fqTi1zNuE5o0RHcDnE2/l Xu2A== 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=1MSOyhRxeOlZZV64ERgtop/oxnrPChw5nLGPyTva4Vo=; b=lSfnlhqPEVlg9uLl5Z+Nq+oPOR9mCLkd5Ns/SckG7eEdp7d3iJZsrmUdzJcWMPy0jb u0AIBJxgMvQP04tEsauGoOkzad/DEKviLPLhQd59r0sb6HO2KXc5ENQ+73cuqlXVawFn ZJUv3NmT8mY/6K9J8ewFdrY0m4F3704jvI0EZxpECoQ7hxvkNcfrkQaAUZn5z8X4YsAG yjGbndgFPrBsVMXusPsbkY8zInpabmlEJcUz2Byh7BOtcLiq9x7Q906cVPCm6XoNPNpM MHIcuah9H/t2JXLK3sP9PHcR2eoUFDcN3wKeMDr+XXBo7RpXf2mKGO0QZ69pMtq0o+WG JWew== X-Gm-Message-State: AOAM5301/ni9QIbhamdJO+avjEZci1DBDi0EHbJeMeZvcOaWhS0gNC/W jyBE29TldZK27kSHN/cmwF8XcSGOsRusD9qEmpw= X-Received: by 2002:aa7:8bcb:: with SMTP id s11mr14668987pfd.170.1593682505328; Thu, 02 Jul 2020 02:35:05 -0700 (PDT) MIME-Version: 1.0 References: <20200701061233.31120-1-calvin.johnson@oss.nxp.com> <20200701061233.31120-4-calvin.johnson@oss.nxp.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 2 Jul 2020 12:34:48 +0300 Message-ID: Subject: Re: [net-next PATCH v2 3/3] net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver To: Ioana Ciornei Cc: "Calvin Johnson (OSS)" , Jeremy Linton , Russell King - ARM Linux admin , Jon , Cristi Sovaiala , Andrew Lunn , Florian Fainelli , "Madalin Bucur (OSS)" , "netdev@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux.cj@gmail.com" , "David S. Miller" , Ioana Ciocoi Radulescu , Jakub Kicinski , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 2, 2020 at 11:48 AM Ioana Ciornei wrote: > > > Subject: [net-next PATCH v2 3/3] net: dpaa2-mac: Add ACPI support for DPAA2 > > MAC driver > > > > Modify dpaa2_mac_connect() to support ACPI along with DT. > > Modify dpaa2_mac_get_node() to get the dpmac fwnode from either DT or > > ACPI. > > Replace of_get_phy_mode with fwnode_get_phy_mode to get phy-mode for a > > dpmac_node. > > Define and use helper function find_phy_device() to find phy_dev that is later > > connected to mac->phylink. ... > > - while ((dpmac = of_get_next_child(dpmacs, dpmac)) != NULL) { > > - err = of_property_read_u32(dpmac, "reg", &id); > > - if (err) > > - continue; > > - if (id == dpmac_id) > > - break; > > + if (is_of_node(fsl_mc_fwnode)) { > > + dpmacs = device_get_named_child_node(fsl_mc, "dpmacs"); > > + if (!dpmacs) > > + return NULL; > > + > > + while ((dpmac = fwnode_get_next_child_node(dpmacs, > > dpmac))) { > > + err = fwnode_property_read_u32(dpmac, "reg", &id); > > + if (err) > > + continue; > > + if (id == dpmac_id) > > + return dpmac; > > + } > > + } else if (is_acpi_node(fsl_mc_fwnode)) { > > + adev = acpi_find_child_device(ACPI_COMPANION(dev->parent), > > + dpmac_id, false); > > + if (adev) > > + return (&adev->fwnode); > > } > > - > > - of_node_put(dpmacs); > > - > > This of_node_put() on the 'dpmacs' node still needs to happen for the OF case. Actually this also raises the question if ACPI case increases refcount or not and it should be fixed accordingly (Note, we have to take reference to fwnode before return in ACPI case and drop reference to adev). -- With Best Regards, Andy Shevchenko