From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BA192D979C for ; Mon, 23 Mar 2026 18:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774290823; cv=none; b=WiLNpv9SkQskmozuOLSnnonP5wDLZhxVLjaRUrM1GJzmc7PVUxkFXhNuYFiUvAT6IEBM9T0Xne6xyujSjD12XKHjx6KFUknRqOBPvz8aecZxxnDDARMm4KJ9cCWW3Ys8dEzScx/PJyX4XKqHCuwP6wCu5/m9iWXCzGyZo2db/6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774290823; c=relaxed/simple; bh=6I3TCajsnbPhvopolFVK3KO9pDXc1m1XrVrTJSIDMJQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t0cgJQvf4tHniACjE1NBr12Gan6asOQI4undIAaBhU3393ItA4ErALk9bmOXwBZxKHs1blF7lpVzWeGkxwf0mkHQXWWVH8HfABc9X7re+RIc5EpTYW4Tf6rhShO9x7v0sDeNh30qPyI1j97LqSNq8CTcgnJWmgpZxDSJ332L27s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=tIw+qtLG; arc=none smtp.client-ip=74.125.82.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tIw+qtLG" Received: by mail-dl1-f47.google.com with SMTP id a92af1059eb24-12a71ade78cso614445c88.0 for ; Mon, 23 Mar 2026 11:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774290821; x=1774895621; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VnYjc2faOHjkbaG+X0+KOSaQNDxXMdAftkLY6+CZb5k=; b=tIw+qtLG94A2vyctJ1nrIkpgQyY6GdyXSxudWeaEhia18nDKP7H2BlmAo+bzO1ezIi SZroA2JPns9tsiLeMtLDEP0iBAiDMhPuwY94Ch9vwu5Nb7kzxQKSjlDb4Uno3JOQoPva 3p2OdOAudQkBOZaHWSaWAPNRZn/OsnD3dJKCN14jNHAD4DaXu3hF0f2dE6vn9ewGTpKy D711seWX5f00wu6/sVlnQL1F3p+/WbV/GJbZo+cZEXwy8JMK+t8PCfvRA9LLH51zU9st LzGjDoaxrG7NJQ86D9iUasPVzjiFa5zJR7vWcUGVKZIzLnsmNHxMwJgLz8UkPqUu8jAo 9G9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774290821; x=1774895621; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VnYjc2faOHjkbaG+X0+KOSaQNDxXMdAftkLY6+CZb5k=; b=kQLfITVZmy4ucq3Tx1f6FbYQ32yqN530VsihpdP2TSXeTq/tx83NeuLzqTHc6ej1vQ G4mLWtXdlPCeYlk5F5jIm9mAs7Jrw7LfXbY1eanrpZLn8bIt86Bd4iU1bW9jlweSAiBf tjthVKL+X08H2lZqcMaeqFoQOzf9N8GNQuc05Z6wXtTyp4DoP6HKQalmo5KlZNRWLbUO oGYL1M3PuCLHl3ZYyNnR9nzA52K41+M1z3TkREDXm5kYNxEEqj4pCtigcJHo3mPMZp/E /4S5lK6yPqPDOVC/GzZGWytvGAHX/awbilfavzGF3MYyqP/77ZkpmeZtDNcnMpMeTVt1 tQlQ== X-Forwarded-Encrypted: i=1; AJvYcCWvU7zAZRVh+124I63uXePr5rlLn/2BCgdbISdZYVI3RJORjQoLx/E3c6fkkaOVioXilcrQdjAyoxPgOoc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzwbcf0NSDtXPaLCsNJDNcURYmHa0bRwZOmvf/A0UeUeyTRI0gW OuexpHjcnwJ6rHm/p88oJB9i6E7IA1CanYdfz2W2eVrBcumMCaxgzGJ1 X-Gm-Gg: ATEYQzxHlVk4CsK7KSEpoMosBt3604GnXS02pkyjS85dDPuQ0lBI24TIutOO6YOg2no B5brAlpMXBHZQSf6xJvnlFmRbW5RI3NTvm5VQd8IabNf7joS8JxkVSkHPi5hRKa9G1xQ6ZfBStz Ydce+VxznlEOAcAkxDqtkJHxfpDwtFxHMQ/ZltAoE4gsrQJ6pQJuWgl3QLdI5ARe0KgbTDXYGJD sXYgl1sFq8nSPjY0XvpxlWer+NOdlJXI8kvXq+aWjBkG8kKS4wx2L4trfQxxZ6CEkLEISbvWgrO PYyhIRdLRMEoqeufbn9HFWRMil/Vb29pHlitFVyljFcCWfMfBJXpirmhIGth4nhAoZfl3bS2TIh msEYC9VC+7pnR80kFpy6QKSkg9J0RW/MnjgsEpLZLmCu6WKiexMFnUQ3AWkWBcS3O7bEz+fudQl jJviFzxVBBZuN0RQH7hpWDNjkWPEZSTResITrCoXT6pt+Fs3GYu5g8J3eo0iPdeYHa X-Received: by 2002:a05:7022:4199:b0:12a:6c7e:bef2 with SMTP id a92af1059eb24-12a72671ad6mr6133919c88.7.1774290821078; Mon, 23 Mar 2026 11:33:41 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:a296:1211:5ab0:bc95]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12a733d199asm9391030c88.4.2026.03.23.11.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 11:33:40 -0700 (PDT) Date: Mon, 23 Mar 2026 11:33:36 -0700 From: Dmitry Torokhov To: "Russell King (Oracle)" Cc: Andrew Lunn , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Neil Armstrong , Mark Brown , Liam Girdwood , Lee Jones , Pavel Machek , Peter Rosin , Heiner Kallweit , Moritz Fischer , Xu Yilun , Tom Rix , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-spi@vger.kernel.org, linux-leds@vger.kernel.org, linux-fpga@vger.kernel.org, driver-core@lists.linux.dev Subject: Re: [PATCH net-next 07/10] net: phy: switch to using class_find_device_by_fwnode() Message-ID: References: <20260322-remove-device-find-by-of-node-v1-0-b72eb22a1215@gmail.com> <20260322-remove-device-find-by-of-node-v1-7-b72eb22a1215@gmail.com> <32679fc0-c388-4cd7-a030-5f5ed5abab78@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Mar 23, 2026 at 08:59:52AM +0000, Russell King (Oracle) wrote: > On Sun, Mar 22, 2026 at 10:17:15PM -0700, Dmitry Torokhov wrote: > > On Mon, Mar 23, 2026 at 03:54:09AM +0100, Andrew Lunn wrote: > > > > - d = class_find_device_by_of_node(&mdio_bus_class, mdio_bus_np); > > > > + d = class_find_device_by_fwnode(&mdio_bus_class, > > > > + of_fwnode_handle(mdio_bus_np)); > > > > > > When you look at this, why is it better? > > > > I think we should move as much as possible towards firmware-agnostic > > APIs and use fwnode_handle instead of device_node or software_node or > > ACPI companion. To discourage this I think we better remove > > firmware-specific APIs where we have firmware-agnostic ones and > > eventually clean up drivers that use OF- or ACPI-specific APIs. > > Basically, no. This is wrong. > > It may sound like a good goal, but there's an underlying issue. This > goal assumes that the firmware description in OF and ACPI are > indentical. If they are different then drivers will make allowance for this, like I2C core or SPI core does. But most of the modern drivers use firmware-agnostic APIs (device_property_*()). ACPI has allowance for device tree properties (via PRP0001 HID entries), and drivers should work with them. > > Sure, looking up devices by fwnode handle makes sense, but looking up > anything that is described in firmware is not suitable for this kind > of conversion, because in doing so, you effectively "port" the DT > bindings to ACPI, and it may not be suitable for ACPI. > > So, please don't make wholesale changes that transfer the DT bindings > into ACPI. > I am not "transferring" anything, but I want to make sure the code works even if we augment OF with software nodes or if DT properties are used in ACPI. Thanks. -- Dmitry