Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2343504pxb; Thu, 3 Feb 2022 04:46:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI44gt7WSkmKhMYswlvlgegNAC2xG1mEGF6YRARpXFQXAIO9gyAD07UjeyLNB7TPnxmz9f X-Received: by 2002:a17:90b:1d0a:: with SMTP id on10mr13510697pjb.79.1643892404413; Thu, 03 Feb 2022 04:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643892404; cv=none; d=google.com; s=arc-20160816; b=yEf2qMMSyT4N4vha8nv2lGRcbbpA1uOCRtP/Xx56SZDc4DRrkoSnmuLAoC57owY6Nd BOqo7hSpFqstKf90S87mGapGSi1xYO+I/o1J+wTbq95+T3P1+DITyu5jWFz941XnFBzx ZGvZa25fKjyyk6FFrrFd7YqsXdZstyLh2nv3v8uvlA3tHUbqqL3da/YqVbLFSXBdA27y TOXzXi6eTaBBu2eFjGKB4K4C6N4p3oMIklHrpi3ozPfK4GQpOI6zFAG63RAykN3oTO+o 9xcLhBTRq+Z+ixDdPnilvzxA553VhjR6+2gbU36gnmqw5ZSISegG+5j6czJcVc5w/8f3 F+Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Jhkc1snR48lXnus5uME2QQbsDzhmJ6iAP7S5roUsBcM=; b=JzbAzYnB5VqxMOhotFpeD98BCzOz+Dj50EYHe+deYynj9kbAYJyQDFi3xgosr2144Y evnekjvOiYXH2TlUtRMjaD/lAvzhtXSooMQztT5VbFrV3Sj7fjcENcO72C5hu8jHoPyr DEApHIKiHa7P5xVgzWmhuNtrM9FZevBDOQqMaikfjuiMzb57YlDnSGlZtt5EOFV5nAbC 27JI0Gs1nJ/ivoHozIitYXKaXOdNnmHQ9/i3t3HuqGsKM0odhKxjGtqY/xHIlEiRhLCj ipPjibaxPb0L9rmVRYmcX8e8BO4NU78u6raMe2K9N7+oS6I/rf/HLyyj3JPjaiBdESZ2 H2YA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11si20488725pfl.285.2022.02.03.04.46.32; Thu, 03 Feb 2022 04:46:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344855AbiBBOTY (ORCPT + 99 others); Wed, 2 Feb 2022 09:19:24 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:59650 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbiBBOTX (ORCPT ); Wed, 2 Feb 2022 09:19:23 -0500 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 4.0.0) id c727b483ca273e5c; Wed, 2 Feb 2022 15:19:22 +0100 Received: from kreacher.localnet (unknown [213.134.175.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 3729B66B422; Wed, 2 Feb 2022 15:19:21 +0100 (CET) From: "Rafael J. Wysocki" To: netdev@vger.kernel.org Cc: Sunil Goutham , Iyappan Subramanian , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Keyur Chudgar , Quan Nguyen , Heiner Kallweit , LKML , Linux ACPI Subject: [PATCH v3] drivers: net: Replace acpi_bus_get_device() Date: Wed, 02 Feb 2022 15:19:20 +0100 Message-ID: <11920660.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.175.227 X-CLIENT-HOSTNAME: 213.134.175.227 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrgeehgdeigecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhephfegtdffjeehkeegleejveevtdeugfffieeijeduuddtkefgjedvheeujeejtedvnecukfhppedvudefrddufeegrddujeehrddvvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudejhedrvddvjedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepuddupdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhgohhuthhhrghmsehmrghrvhgvlhhlrdgtohhmpdhrtghpthhtohepihihrghpphgrnhesohhsrdgrmhhpvghrvggtohhmphhuthhinhhgrdgtohhmpdhrtghpthhtoheprghnughrvgifsehluhhnnhdrtghhpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhl ohhfthdrnhgvthdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhgvhihurhesohhsrdgrmhhpvghrvggtohhmphhuthhinhhgrdgtohhmpdhrtghpthhtohepqhhurghnsehoshdrrghmphgvrhgvtghomhhpuhhtihhnghdrtghomhdprhgtphhtthhopehhkhgrlhhlfigvihhtudesghhmrghilhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=11 Fuz1=11 Fuz2=11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev(). While at it, rearrange the local variable definitions in bgx_acpi_register_phy() and mdio-xgene.c:acpi_register_phy() so as to put them in the reverse xmas tree order. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- v2 -> v3: Fix a build issue and avoid changing the lists of local variables (Jakub Kicinski). -> v2: Put local variable definitions in two functions in the reverse xmas tree order (Andrew Lunn). --- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 3 ++- drivers/net/fjes/fjes_main.c | 5 ++--- drivers/net/mdio/mdio-xgene.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) Index: linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c =================================================================== --- linux-pm.orig/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -1409,7 +1409,8 @@ static acpi_status bgx_acpi_register_phy struct device *dev = &bgx->pdev->dev; struct acpi_device *adev; - if (acpi_bus_get_device(handle, &adev)) + adev = acpi_fetch_acpi_dev(handle); + if (!adev) goto out; acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac); Index: linux-pm/drivers/net/fjes/fjes_main.c =================================================================== --- linux-pm.orig/drivers/net/fjes/fjes_main.c +++ linux-pm/drivers/net/fjes/fjes_main.c @@ -1514,10 +1514,9 @@ acpi_find_extended_socket_device(acpi_ha { struct acpi_device *device; bool *found = context; - int result; - result = acpi_bus_get_device(obj_handle, &device); - if (result) + device = acpi_fetch_acpi_dev(obj_handle); + if (!device) return AE_OK; if (strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID)) Index: linux-pm/drivers/net/mdio/mdio-xgene.c =================================================================== --- linux-pm.orig/drivers/net/mdio/mdio-xgene.c +++ linux-pm/drivers/net/mdio/mdio-xgene.c @@ -285,7 +285,8 @@ static acpi_status acpi_register_phy(acp const union acpi_object *obj; u32 phy_addr; - if (acpi_bus_get_device(handle, &adev)) + adev = acpi_fetch_acpi_dev(handle); + if (!adev) return AE_OK; if (acpi_dev_get_property(adev, "phy-channel", ACPI_TYPE_INTEGER, &obj))