Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3165780pxb; Tue, 12 Jan 2021 07:53:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNq6ZhH9YMbwDhNqyvKV/8XBH1HU7QHh8gBMQ7D1WrUGosay8QC+Xy762na1laYtVLgphc X-Received: by 2002:a05:6402:3487:: with SMTP id v7mr1417776edc.68.1610466834674; Tue, 12 Jan 2021 07:53:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610466834; cv=none; d=google.com; s=arc-20160816; b=qpqmOaEBol8CRnGHeezQVqGpIu06jOb9S+MJsR9P9zn/L/P+GPHVXbTo2JUesHoiY6 nT15wAZBpI7OvRQiCPMKRkoKQ5xJ0f2wOFkh1ajtAIrg2OFHS8i7hzS+y//zovsn+bkL VoIKV/FyHKz9h11gdxMo3ejGfP2DfPSnZTOyLKXAVHKHickaQuRB1HXjJbar7u6eD8fi A+LzE3I/CYG7UNu6DzyUVwdOcHLYG0SKj7bkwN6dOr0kZXSC4pzt1UJFsmljunTevycs nn1H68OWfHc61tkG28ZhQlnOq5RVFWqNdWll0YfAFVseHjKBF+m3FF3LAwtqsG/Vge2+ B2QA== 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=R3JNDoPNmh/xsSk6z7wd+DpVkA7tUE/GQpUzABypsAE=; b=Oc/+BiqhIgIMIjuY4yjQ2trku6gvv0RWLvyqQCu8sRcYLC9DEypcQC7QxljQRRg6Fi wLP4bHXMROv5cyELZwS7xf7DHKWKgzMs8mwNQFsf5Sn52YQi3v7RbPoRAiqXsv6PwSU8 l1nUMLtdQSPL2MEQ5CXoyZHmRwJm/cbsILEgmIdDduA+xPNXAxfoAOtdp1YJD/PXQ0aB /2afIyNTr8SKb/gQHjph/Bja6YheA936Z41cLO3QGaplxh8HnK4Yr/9wzpyYyH4NhbQw r8dowNThCBRTr52HhEFOa5GV2FB44OWtXpzUj0wDR+yQchAMr19NgyzDOddOoXj4MUX/ 2atg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nZ6i5UFf; 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 r24si1460478edc.286.2021.01.12.07.53.30; Tue, 12 Jan 2021 07:53:54 -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=nZ6i5UFf; 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 S2392045AbhALPv5 (ORCPT + 99 others); Tue, 12 Jan 2021 10:51:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733044AbhALPvz (ORCPT ); Tue, 12 Jan 2021 10:51:55 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27AB2C061786; Tue, 12 Jan 2021 07:51:15 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id r4so1591308pls.11; Tue, 12 Jan 2021 07:51:15 -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=R3JNDoPNmh/xsSk6z7wd+DpVkA7tUE/GQpUzABypsAE=; b=nZ6i5UFfAjxhQv39XnaJ63fnIyBFz4lpd7xk6yh39Qbit4d8OQl+7X7NuumhQ3zMIQ RrYQYwW4SOCqWbC6KmmcVkHoAMc3WSnORK/cBFFsVRXtivb2E0eGpti3cD58qTeYIE/g 9wCd85fOYnHJdaaqv9TkEJXz3t+QLQMDwm/Wrnwc07VH3yZoDB46G1j3mkiXJ+jrntxY 3JU1qSCe83wmvescrkQOMEi/nmdM6Jwxu6X5QMrHo6oQSor+NUPVjqOJ7ZYE7dV1aZN4 WaFf3KJgDbEDC2pDDeUzKS9nhxAW/Z+lkFtrxi4FyBRYj0ImbunPTJrQzUm2r1R4kkPg 9pPw== 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=R3JNDoPNmh/xsSk6z7wd+DpVkA7tUE/GQpUzABypsAE=; b=C4MCWWgMYqY124SZqE+cA7VaI1rMIg0oG3zJalUaeQLiqDrAJJ0lXmhq6rSmrnX0q2 P7sI/oxDI5c4cUXVXlSTwGM2JHdhuwFtO5NqgclDJ6ECdrvlslJ9EZA3lRSSS3p/qimI jBZUbcuFarZEzyYlftk9lBE3PK6+e2rtN7TVRW2Lp4ezaydYJAI95snOn57KmnM0ce69 QEihMCF6dCAtn1qkLEORnEuIKZ+ITSKXZORTPTeJKrNBek5n7b1DpgPxIvCA/ujHaPWu qS+oxNvweaUfDdEDhHoU0ws52pM2YoJuYqWYCEDFWhDWBFTExV9iEm1apCQ11V+WYbQj rATA== X-Gm-Message-State: AOAM531VRuaRv1xp2GbJvGghNULkJxUm8kjCtCYpy/CkiUmJZAInzjUE Fz7Y3SiU8kz6g5i0KX84XK8bL+dr2G03cdmLBhk= X-Received: by 2002:a17:90a:1050:: with SMTP id y16mr5384547pjd.181.1610466674728; Tue, 12 Jan 2021 07:51:14 -0800 (PST) MIME-Version: 1.0 References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> <20210112134054.342-12-calvin.johnson@oss.nxp.com> In-Reply-To: <20210112134054.342-12-calvin.johnson@oss.nxp.com> From: Andy Shevchenko Date: Tue, 12 Jan 2021 17:52:03 +0200 Message-ID: Subject: Re: [net-next PATCH v3 11/15] net: mdiobus: Introduce fwnode_mdiobus_register() To: Calvin Johnson Cc: Grant Likely , "Rafael J . Wysocki" , 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 , Linux Kernel Mailing List , netdev , Laurentiu Tudor , ACPI Devel Maling List , "linux.cj" , linux-arm Mailing List , "David S. Miller" , Heiner Kallweit , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 3:42 PM Calvin Johnson wrote: > > Introduce fwnode_mdiobus_register() to register PHYs on the mdiobus. > If the fwnode is DT node, then call of_mdiobus_register(). > If it is an ACPI node, then call acpi_mdiobus_register(). ... > +/** > + * fwnode_mdiobus_register - Register mii_bus and create PHYs from fwnode > + * @mdio: pointer to mii_bus structure > + * @fwnode: pointer to fwnode of MDIO bus. > + * > + * This function returns of_mdiobus_register() for DT and > + * acpi_mdiobus_register() for ACPI. > + */ > +int fwnode_mdiobus_register(struct mii_bus *mdio, struct fwnode_handle *fwnode) > +{ > + if (is_of_node(fwnode)) > + return of_mdiobus_register(mdio, to_of_node(fwnode)); > + else if (is_acpi_node(fwnode)) Redundant 'else' > + return acpi_mdiobus_register(mdio, fwnode); > + > + return -EINVAL; > +} -- With Best Regards, Andy Shevchenko