Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1747308ybz; Sat, 18 Apr 2020 07:40:45 -0700 (PDT) X-Google-Smtp-Source: APiQypIpHwHLawOjCLvZyulDIxhHiLK/xCqs/3XkBdpSp4dblwS8sSYerougnTfabM7ZK0pkJKiq X-Received: by 2002:a50:e8cb:: with SMTP id l11mr7777767edn.174.1587220844885; Sat, 18 Apr 2020 07:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587220844; cv=none; d=google.com; s=arc-20160816; b=a3AP/vgzIGhZELxYO9IAcVT/+inBxcOVq0Nv1HBVocBFpIY0njH/8Kwt9vhbuil/r/ 60+69aCdjD/l+d5nhNQNDi8dmSnrT+iSP3wStgusfLpGJIxuFlPApKIs/tgdAeH+IDOr xfb79Yib3yAaIudHt01cuNS64waPvEyKiGyDrfc9GFGwjzt3U3T3kZfBZOGRcSyvmHvb FfKFBBaAzt+BmLUz/hNnSgkAQGbzhdVbY3UWdMBGA5kbaOqES871G+KBGBLdayVWYno2 L+8DNdLVNQEdbIZBSzS47/c9wKSmA/P6V0tTgruFVLrvAu7EqrzKOjqNXrEI5kmSEdiP 4Ptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1LsCjVacgDNgCyib7rEtoSFJWVTL9FJKR4yzQpOfwYg=; b=IBKzbcmuYjPfT+eZgVwkzz2ymeIO2Vjl5OKRPIvd8hDmdqN5YecVx1dw07FvKaYyFB z4uMUuHG7UyHUByZG4sUKkkha3ysjoLjpzougKpyTuSumRHqYzljlmuIc2jT7i+8Xqeo hWImsyyz2VLLS0awbkx4UF61DQqBopkdSQEWwczfvuxSo2REq55iKhlXnKqgNpJbya/5 69Yk5OVThoPtfKoj1J9MhAklRyBQNQ/L7t1KWJIzykuPMCrVXEN958lBU/ezrBHKgND0 PVLdpDC1GjFW2U4PAg8MPGwcuP8hrQiNcz2XURyiyJivuljpVcFcB4uZFwogWbBH2+ms w2jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=UrQgm4vL; 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 a11si16485056edn.170.2020.04.18.07.40.21; Sat, 18 Apr 2020 07:40:44 -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=fail header.i=@lunn.ch header.s=20171124 header.b=UrQgm4vL; 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 S1726296AbgDROjL (ORCPT + 99 others); Sat, 18 Apr 2020 10:39:11 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46482 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbgDROjK (ORCPT ); Sat, 18 Apr 2020 10:39:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1LsCjVacgDNgCyib7rEtoSFJWVTL9FJKR4yzQpOfwYg=; b=UrQgm4vL1ovuJYFTO+d+97W3Qs TCvDjd0CNLvezkYbzOVdaG5akr/ykupJjk7WO1yvDFwqYS16vyIEWFeY87wFH3ZtWJHL6Cr1zdiuO Y0WiLKT375DuF8uGMnfREUff7WFSnp9EB7x6V+XcdicIyOPEwXy2PcZ+sWZo/hA2l26k=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jPocZ-003TEL-8P; Sat, 18 Apr 2020 16:39:03 +0200 Date: Sat, 18 Apr 2020 16:39:03 +0200 From: Andrew Lunn To: Russell King - ARM Linux admin Cc: Calvin Johnson , linux.cj@gmail.com, Jeremy Linton , Andy Shevchenko , Florian Fainelli , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , netdev@vger.kernel.org, Laurentiu Tudor , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Diana Madalina Craciun , linux-kernel@vger.kernel.org, Varun Sethi , Marcin Wojtas , "Rajesh V . Bikkina" , Pankaj Bansal , Makarand Pawagi , "David S. Miller" Subject: Re: [RFC net-next PATCH v2 1/2] net/fsl: add ACPI support for mdio bus Message-ID: <20200418143903.GF804711@lunn.ch> References: <20200418105432.11233-1-calvin.johnson@oss.nxp.com> <20200418105432.11233-2-calvin.johnson@oss.nxp.com> <20200418114116.GU25745@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200418114116.GU25745@shell.armlinux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +static int xgmac_mdiobus_register_phy(struct mii_bus *bus, > > + struct fwnode_handle *child, u32 addr) > > +{ > > + struct phy_device *phy; > > + bool is_c45 = false; > > + int rc; > > + const char *cp; > > + u32 phy_id; > > + > > + fwnode_property_read_string(child, "compatible", &cp); > > + if (!strcmp(cp, "ethernet-phy-ieee802.3-c45")) > > + is_c45 = true; > > + > > + if (!is_c45 && !xgmac_get_phy_id(child, &phy_id)) > > + phy = phy_device_create(bus, addr, phy_id, 0, NULL); > > + else > > + phy = get_phy_device(bus, addr, is_c45); > > + if (IS_ERR(phy)) > > + return PTR_ERR(phy); > > + > > + phy->irq = bus->irq[addr]; > > + > > + /* Associate the fwnode with the device structure so it > > + * can be looked up later. > > + */ > > + phy->mdio.dev.fwnode = child; > > + > > + /* All data is now stored in the phy struct, so register it */ > > + rc = phy_device_register(phy); > > + if (rc) { > > + phy_device_free(phy); > > + fwnode_handle_put(child); > > + return rc; > > + } > > + > > + dev_dbg(&bus->dev, "registered phy at address %i\n", addr); > > + > > + return 0; > > You seem to be duplicating the OF implementation in a private driver, > converting it to fwnode. This is not how we develop the Linux kernel. > We fix subsystem problems by fixing the subsystems, not by throwing > what should be subsystem code into private drivers. And i think a similar comment was given for v1, but i could be remembering wrongly. Andrew