Received: by 2002:ab2:644:0:b0:1ec:cbc4:63fb with SMTP id 4csp1141972lqn; Mon, 26 Feb 2024 08:50:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWI3MnxQU7f3/nkJKoe+jLcG6EePh+vmznSI9QwR4F/sxNu1aQSbDa/gM8qRJMqrmZCMQxRUAa7TkgoR63t6cVoLOOVK1URFGwnkmzSpA== X-Google-Smtp-Source: AGHT+IG7IIM76/n2y8pHy3T5lV19Puw/beyfGIoaqRjA+6B+ihfHN/Vb6X1qkKAN9vsyo21PeyCF X-Received: by 2002:a05:6870:e98:b0:21e:6c0d:41cd with SMTP id mm24-20020a0568700e9800b0021e6c0d41cdmr8270629oab.38.1708966206824; Mon, 26 Feb 2024 08:50:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708966206; cv=pass; d=google.com; s=arc-20160816; b=qceOILhJQKD0OvC7Kd2Gf45r6dqdMMt+qhCHMwg6mPhOAvYmmOtb+Py7cS1PORrbz4 YdWdukLCf0gXGUSsDhU6jRU3h2a2b5wvB6DbkIlTHh3G3EZApS3YUoyK4J7BRGGjidOv YDvgtv6/jyAFQTmgMNbxtMBlJ3/q4RIOUl6CK9swwecNoA2QlT2MB3Kl2NQwSX5pv7+L zACZhhxzzt7o0MHFffVKWwmrC5aJKzeqE/JXxGAsZ+8hNnLRUk8OcoWO2fj0Hmc58NJy tkPhtQKWHRO1Vj4I+FECfMXMpSLHzcgbDUaiUpm7dql2ZusW9Nj6pD7QopdpFyHMoUYJ vVJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=6auEU26+vrivbR5NR8j7v17Mmzz73LvUwHdwC5AeGQI=; fh=5+l2SrXOgWW2LeMkk5qEo3bEhUTfBFk99LgCm0rIQ8I=; b=UY1jGZ6DdfxXJT/lfudB6R2Rk+a3nsWsEbZON5Bduuzd3ZKvupA5MLrYG6lTdXnc1T BPuV4TTrZjn1klYPNOaLcpYCKKmrLhw1dCAPIAokkwHk7lqnIRRHPePoJ05KEEdrVw03 +8bs8DnxgyMpFVT+QaYmvcG49mTFdmbiQxvzajtjiHktIoiPoMjrzfe7ZY24Me0CItaM Ak2A4EEfcc54D+ENHEAVY9I7nPDEt8ElvgsIEosMpMB7h/U9y3YW8R+EQB+oBrXcLqjG 4ZCn01zdMf5EqEntyWJHqRHp5TY41icP3mnchPKSGk4tHRtWsvAnUZuj7SHvBlit9E51 UbIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81938-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wi4-20020a05620a570400b00786a450ec37si5439654qkn.296.2024.02.26.08.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 08:50:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81938-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81938-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8BA9E1C2B7BD for ; Mon, 26 Feb 2024 16:50:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0467C12D77B; Mon, 26 Feb 2024 16:49:44 +0000 (UTC) Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.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 DE15B12CDB8; Mon, 26 Feb 2024 16:49:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966183; cv=none; b=HhnoibVq/854MVEe4AjrotlwnJ1p/uFJbNMO3iD4L+gGHrDhsG4dWkofMSqbN/NecMkcXSB/onwuTJYFhMLeh0Ik1pyxWExdSEklLB6pbfm4/i4fnLcbf+xojOhVJlPh0KB8JwYeQW2lM7lHZKbshmqdOV43Gc38Nj6scl7kzaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966183; c=relaxed/simple; bh=CC8Bq496gBK0CbLLvpBBLkKHW8DXcXn0l6RFjvn84dI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dZ+HCN38WFQtRGwg54SLIRYSW6CjaJmF+LkcjwhujaJixykbFRnS1W2sHIeJqZCHpV878EoK+7iUKhTHLLXcjaLeetwnHtMZJQ/86qNB3ox/tbcFG/rnrvWF2zlgIKP9DTBifr+gJTICVhxngopan831Mz7bWthJT0b/qan4mwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-59fc31c57easo1118768eaf.1; Mon, 26 Feb 2024 08:49:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708966181; x=1709570981; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6auEU26+vrivbR5NR8j7v17Mmzz73LvUwHdwC5AeGQI=; b=OAvrJH7nrH+LBpnk81rIE6CXBSzWAoLIm2SIwQq4Td8ZaibsTXUZVqmWpacwxDdjCo 5FJN3t8ifF9ptfm2IKTunY9aKKL8WenmrA3X56GRJ6Uj94672nklD8CrgZX4j59BNdWG EPiaYei7SOhfmQXL50IiWqkMJ736gMdD+w4ceWLFkvj0IIcYaAq6HdpsKjmK+XExpKl2 ILKQJ3xXMKhxXoS2ZzCCe8xfPCH6Ow9ZhJYgJPO4qWSFsz2DAhLX8WgMee2N8eytE+z6 OGKW/Xfgsltz1ArZ/Ixlox9gFFZg1zXW72nLtKlVHmDKS3hh8E4bNO5UFQWI1w3gZXwT IZEQ== X-Forwarded-Encrypted: i=1; AJvYcCWgrAtDCHjAib0yfTYpF7QmOpFx/yKbLSzOStPpTxxpCVMjvTO81eS8OcSYhomh4yYeZTugt4epIjRWUnnYqQwmdnwA7O49ULXUnoc3 X-Gm-Message-State: AOJu0YzgORBijK5sMRLtNxjz1/fXx1La/ZczLoTM3k34Ai9MWMUfzifC ipuhGupJmM5ZqZStQ5JTmUvqehD4wo3EJRt5hdOus2l+laZJPz5bNVc0f6X5p3nSNDdP3pML1QF +7fhrSEG6pzJ8J7otTWLb+k/hFZQ= X-Received: by 2002:a4a:d996:0:b0:5a0:4216:c5f0 with SMTP id k22-20020a4ad996000000b005a04216c5f0mr6957887oou.0.1708966180928; Mon, 26 Feb 2024 08:49:40 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <6021126.lOV4Wx5bFT@kreacher> <2175138.irdbgypaU6@kreacher> In-Reply-To: <2175138.irdbgypaU6@kreacher> From: "Rafael J. Wysocki" Date: Mon, 26 Feb 2024 17:49:29 +0100 Message-ID: Subject: Re: [PATCH v2 2/5] ACPI: scan: Relocate acpi_bus_trim_one() To: Jonathan Cameron Cc: Linux ACPI , LKML , Mika Westerberg , "Rafael J. Wysocki" , "Russell King (Oracle)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 26, 2024 at 5:47=E2=80=AFPM Rafael J. Wysocki wrote: > > 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 > --- > > v1 -> v2: Add R-by from Jonathan. I actually forgot to add the R-bys, but let's assume they are here (no need to look at the first two patches again). > --- > drivers/acpi/scan.c | 52 ++++++++++++++++++++++++++-------------------= ------- > 1 file changed, 26 insertions(+), 26 deletions(-) > > Index: linux-pm/drivers/acpi/scan.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- 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 =3D adev->handler; > + > + acpi_dev_for_each_child_reverse(adev, acpi_bus_trim_one, NULL); > + > + adev->flags.match_driver =3D false; > + if (handler) { > + if (handler->detach) > + handler->detach(adev); > + > + adev->handler =3D NULL; > + } else { > + device_release_driver(&adev->dev); > + } > + /* > + * Most likely, the device is going away, so put it into D3cold b= efore > + * that. > + */ > + acpi_device_set_power(adev, ACPI_STATE_D3_COLD); > + adev->flags.initialized =3D false; > + acpi_device_clear_enumerated(adev); > + > + return 0; > +} > + > static int acpi_scan_hot_remove(struct acpi_device *device) > { > acpi_handle handle =3D 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 =3D adev->handler; > - > - acpi_dev_for_each_child_reverse(adev, acpi_bus_trim_one, NULL); > - > - adev->flags.match_driver =3D false; > - if (handler) { > - if (handler->detach) > - handler->detach(adev); > - > - adev->handler =3D NULL; > - } else { > - device_release_driver(&adev->dev); > - } > - /* > - * Most likely, the device is going away, so put it into D3cold b= efore > - * that. > - */ > - acpi_device_set_power(adev, ACPI_STATE_D3_COLD); > - adev->flags.initialized =3D false; > - acpi_device_clear_enumerated(adev); > - > - return 0; > -} > - > /** > * acpi_bus_trim - Detach scan handlers and drivers from ACPI device obj= ects. > * @adev: Root of the ACPI namespace scope to walk. > > >