Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1704469pxb; Wed, 2 Feb 2022 10:36:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYRG/dyWZMNVqpSKydg3V+3uawJ3F3XCxJGYyPQ1JdMqQcAJDKG3bVigFcCvRT6hIcNS/B X-Received: by 2002:a17:90b:3810:: with SMTP id mq16mr9583326pjb.95.1643826982078; Wed, 02 Feb 2022 10:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643826982; cv=none; d=google.com; s=arc-20160816; b=yNwSkpZWEcb8LIfiqU3AgaYMjMr2nlJ7V2D33hz07bA3WLBe+S2yVM+Cbb4OtXSxTQ VgWLbqBPY/BcedqNIQcd6iHup6kuYB2bgwwBtxRAl1hKdFcHpAnvnihRLnjMpH51xh87 tOkFL7CFA9oEcXHCGPh7DfQEdxhA/goKisXkQj210+19A7uUzvQViUeJszeaTvX55Iqw RwAmvmZ0HW2t5/RnAtNwSuCkeJS3Kr4xUzRWEe8H8UHxrtxzOg3GeQGzePJbuiXIW7Qb E+5B1UiRtJaHegfjl1T8dJM/7TJ5xE021uGzboLi1SS6uqsAZWsMfeTvKDJKhUdVmCK0 CA1A== 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=uCfdp6TrFNVgUQpF1/YGOdnIrExiKxGRuunzU+DXlks=; b=pcT+Vk5FOE2Norwx53dWSmOaa4AUyOPASy2S/n7BimuWXyrv7YEL4iUiKw0X8z+b6P fIPmCikKOMd5q1OEPWMwMetCq11zjUrKho1E4Bn9yFjzDAiub8HsAVTrtvNAl42D/luL dBPPj9zBt44FoLDg7k7AIlz7aL414dg3MkEh+cDkKOU/r4vLNZKPoNU8AEOV32wINnMZ 4OQTl0i4r2ftQCXSTuoQp2gwwi0aEr81A4Me7TSEo5pNAZ7ghmQsvkSXMd64mmBbWFoU U+cjsJYJURFU5sKJjwf3AxRHA9fTOjkP2W/zAVrt7ZYc73OFI8vkipAUKG6BnO+ZMOPK yawQ== 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 f127si19233421pgc.335.2022.02.02.10.36.09; Wed, 02 Feb 2022 10:36:22 -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 S239964AbiBATHO (ORCPT + 99 others); Tue, 1 Feb 2022 14:07:14 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:45970 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241933AbiBATHM (ORCPT ); Tue, 1 Feb 2022 14:07:12 -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 21f654da68e8f2ef; Tue, 1 Feb 2022 20:07:10 +0100 Received: from kreacher.localnet (unknown [213.134.162.64]) (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 7735366B3BC; Tue, 1 Feb 2022 20:07:09 +0100 (CET) From: "Rafael J. Wysocki" To: Sunil Goutham , Iyappan Subramanian , Andrew Lunn Cc: "David S. Miller" , Jakub Kicinski , Keyur Chudgar , Quan Nguyen , Heiner Kallweit , netdev@vger.kernel.org, LKML , Linux ACPI Subject: [PATCH] drivers: net: Replace acpi_bus_get_device() Date: Tue, 01 Feb 2022 20:07:08 +0100 Message-ID: <3151721.aeNJFYEL58@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.162.64 X-CLIENT-HOSTNAME: 213.134.162.64 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrgeefgdduvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpefhgedtffejheekgeeljeevvedtuefgffeiieejuddutdekgfejvdehueejjeetvdenucfkphepvddufedrudefgedrudeivddrieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeivddrieegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeduuddprhgtphhtthhopehsghhouhhthhgrmhesmhgrrhhvvghllhdrtghomhdprhgtphhtthhopehihigrphhprghnsehoshdrrghmphgvrhgvtghomhhpuhhtihhnghdrtghomhdprhgtphhtthhopegrnhgurhgvfieslhhunhhnrdgthhdprhgtphhtthhopegurghvvghmsegurghvvghmlhhofhhtrdhnvghtpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdp rhgtphhtthhopehkvgihuhhrsehoshdrrghmphgvrhgvtghomhhpuhhtihhnghdrtghomhdprhgtphhtthhopehquhgrnhesohhsrdgrmhhpvghrvggtohhmphhuthhinhhgrdgtohhmpdhrtghpthhtohephhhkrghllhifvghithdusehgmhgrihhlrdgtohhmpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhg 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(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 4 ++-- drivers/net/fjes/fjes_main.c | 10 +++------- drivers/net/mdio/mdio-xgene.c | 8 +++----- 3 files changed, 8 insertions(+), 14 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 @@ -1407,9 +1407,9 @@ static acpi_status bgx_acpi_register_phy { struct bgx *bgx = context; struct device *dev = &bgx->pdev->dev; - struct acpi_device *adev; + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); - if (acpi_bus_get_device(handle, &adev)) + 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 @@ -1512,15 +1512,11 @@ static acpi_status acpi_find_extended_socket_device(acpi_handle obj_handle, u32 level, void *context, void **return_value) { - struct acpi_device *device; + struct acpi_device *device = acpi_fetch_acpi_dev(obj_handle); bool *found = context; - int result; - result = acpi_bus_get_device(obj_handle, &device); - if (result) - return AE_OK; - - if (strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID)) + if (!device || + strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID)) return AE_OK; if (!is_extended_socket_device(device)) 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 @@ -280,15 +280,13 @@ static acpi_status acpi_register_phy(acp void *context, void **ret) { struct mii_bus *mdio = context; - struct acpi_device *adev; + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); struct phy_device *phy_dev; const union acpi_object *obj; u32 phy_addr; - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; - - if (acpi_dev_get_property(adev, "phy-channel", ACPI_TYPE_INTEGER, &obj)) + if (!adev || + acpi_dev_get_property(adev, "phy-channel", ACPI_TYPE_INTEGER, &obj)) return AE_OK; phy_addr = obj->integer.value;