Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2578862rdb; Wed, 21 Feb 2024 12:05:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV5VtF1ikaaNu0Z95L4w2CRIMObMJvxHsiuChTwtEBSUqYNRTyEtqtlwq5oNm7UR3vtAdYkiE6PCy7MAaxfFARDrsPa/dd125nAKvNMpQ== X-Google-Smtp-Source: AGHT+IFKmSuuIVxRSFwrTCmCyvH6FKnD0orSkHA1FL3CVEJWSLop2rkNP8xrQJdiR3pka5r5rw1Q X-Received: by 2002:a17:903:483:b0:1dc:212d:a9f8 with SMTP id jj3-20020a170903048300b001dc212da9f8mr3636907plb.64.1708545928955; Wed, 21 Feb 2024 12:05:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708545928; cv=pass; d=google.com; s=arc-20160816; b=HER5lyDqbWUJY6kJ0SFb6GcyrQ7Oj50gI6iZ2+8fELXdpD3QIj4NvZHsTsfE8moJYz XNFsdzADWGdYKD0AN88YtPhZtDqzTW1iwCRBMLDWC2ec1pnyr46Pyr60xRL2i77Yr1vz aCc2PpeJasfhEm//B1Xu6U4EimMufO0RhN6ToIDg6j82IBuya6e83IRMRze7H0ZXBTbt rWR8yLKiH7KrWqjRweKiAcZHBtlf2pmAr9blpz/sVlmzunwaNmASn0zXWiDk7Tnq9VD6 RVLOSsidEbkuDVOwB/sAtOPYxHA+/pU12GrRDeuwed4h5i7cqW1HKwcdhxtt7BD+abQ0 7Rng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=eFF/IM5C+uM/fCtCikk2ixeNqdbLBPzLcmKrNLbKDRc=; fh=s5Fc0MEg8Xcp85xwyejK4S4zs7msQB7g1OY0X3YpOJg=; b=J9BpoqyLgs4Corm4q5VVBbQ+EM/a3JQfwR/gyab67E+l1Zkmgm0D1jnjwyuSyZvWmW 9Bw/PISUOew6eFYNOcFQ1lhL4XcJv4eefQYQCKRqY5C3BHSiyBFv3Q/4H7ghDWQXNkPo U9CTfTDN7+dYPSJusrjqbqnpsnc9wXSFaZUsmO4EBt+L4UC304j2WrYvlGC8aeEFebzm R4VbtE7dLqNAE11SZhGXsv0OkCywwSK+MQVP2xVin7eSlbFjPau90VPCWTGZyOvAQFzO jJ4TN+2BRWBS+hIh1Ga8ENcamNbKM1ctTDoRi2ZccH21UqjpXr7BK4a/4X7JH5nL9qc0 h1eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75445-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u11-20020a17090341cb00b001dc1df648afsi3180249ple.489.2024.02.21.12.05.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:05:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75445-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2AB9628420A for ; Wed, 21 Feb 2024 20:05:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A77EC126F1D; Wed, 21 Feb 2024 20:04:48 +0000 (UTC) Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E47DE86151; Wed, 21 Feb 2024 20:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708545888; cv=none; b=om4YFqH/hsPNeMM0o02w+DPUdSGnbzenTKXXB5lgDfH6xbeYeHItXdo3uyd0wqRyItsRw1g51GW0TwWvBFd6w8JTuZG+FcP85iOBdVkkbYxu6PuQxhr4WVJlR4SucuBnaEjST6w02sJhryR//TCkCT44ibvbc+u6bCAEwybrPEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708545888; c=relaxed/simple; bh=ZsHdlJrJVlvGSfzCG6LWBqpX9udtvXpPnuXEOa0+fSY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dTk0zeuKKalDGrFxydzLXsGXe9+pQBRZxVLZPqNLF3Fy0EULIRFeJW7jXHDIQvnnzhHknxSmV4L2Tty2HMWnF2+cKxZpKpzCt6G/7x9HWUlhFr4uXTv02SSISTEIMV2VIraDxQ1eZasDF84C5uUL3IFkLakCxDN5Ye1ewPqy15Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net 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 5.4.0) id 67b712691066ea71; Wed, 21 Feb 2024 21:04:38 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (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 cloudserver094114.home.pl (Postfix) with ESMTPSA id 89EF366A243; Wed, 21 Feb 2024 21:04:37 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI , Jonathan Cameron Cc: LKML , Mika Westerberg , "Rafael J. Wysocki" , "Russell King (Oracle)" Subject: [PATCH v1 2/4] ACPI: scan: Relocate acpi_bus_trim_one() Date: Wed, 21 Feb 2024 21:01:48 +0100 Message-ID: <2189881.irdbgypaU6@kreacher> In-Reply-To: <4562925.LvFx2qVVIh@kreacher> References: <4562925.LvFx2qVVIh@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvgddufedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepiedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehjohhnrghthhgrnhdrtggrmhgvrhhonheshhhurgifvghirdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgv lhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugiesrghrmhhlihhnuhigrdhorhhgrdhukh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 From: Rafael J. Wysocki Relocate acpi_bus_trim_one() (without modifications) so as to avoid the need to add a forward declaration of it in a subsequent patch. No functional changes. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -244,6 +244,32 @@ static int acpi_scan_try_to_offline(stru return 0; } +static int acpi_bus_trim_one(struct acpi_device *adev, void *not_used) +{ + struct acpi_scan_handler *handler = adev->handler; + + acpi_dev_for_each_child_reverse(adev, acpi_bus_trim_one, NULL); + + adev->flags.match_driver = false; + if (handler) { + if (handler->detach) + handler->detach(adev); + + adev->handler = NULL; + } else { + device_release_driver(&adev->dev); + } + /* + * Most likely, the device is going away, so put it into D3cold before + * that. + */ + acpi_device_set_power(adev, ACPI_STATE_D3_COLD); + adev->flags.initialized = false; + acpi_device_clear_enumerated(adev); + + return 0; +} + static int acpi_scan_hot_remove(struct acpi_device *device) { acpi_handle handle = device->handle; @@ -2547,32 +2573,6 @@ int acpi_bus_scan(acpi_handle handle) } EXPORT_SYMBOL(acpi_bus_scan); -static int acpi_bus_trim_one(struct acpi_device *adev, void *not_used) -{ - struct acpi_scan_handler *handler = adev->handler; - - acpi_dev_for_each_child_reverse(adev, acpi_bus_trim_one, NULL); - - adev->flags.match_driver = false; - if (handler) { - if (handler->detach) - handler->detach(adev); - - adev->handler = NULL; - } else { - device_release_driver(&adev->dev); - } - /* - * Most likely, the device is going away, so put it into D3cold before - * that. - */ - acpi_device_set_power(adev, ACPI_STATE_D3_COLD); - adev->flags.initialized = false; - acpi_device_clear_enumerated(adev); - - return 0; -} - /** * acpi_bus_trim - Detach scan handlers and drivers from ACPI device objects. * @adev: Root of the ACPI namespace scope to walk.