Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5541900pxb; Wed, 26 Jan 2022 14:35:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJza8zKnFWTwv8q7Fs1y74ZOIxe07HyR02+ItXrQPVylstjMicZvcFz5IbVEN6ebs1Ff1VY+ X-Received: by 2002:aa7:cd44:: with SMTP id v4mr1040757edw.69.1643236504113; Wed, 26 Jan 2022 14:35:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236504; cv=none; d=google.com; s=arc-20160816; b=LObfHNDlCpkZV9WtMUUhLsaUDLyZT/TeWn9b3YFPj/++NFCD0XegNdQReqlqbE9LkR ANu42c2zlKXyo2NvFXUnE+XrNkbMBVai3HEMfhDkFGUEZFkhaCgYbv5z8punpb5TSyCG HbnfELXHpilWtUVhu7BrH4puUvpzxRmhtwu3FG3cTIRGN7iG3XbGHtMJVVaO6Mwyccvw JGGDXNywOjJ+fm/uJmWyjOnjFkJBc1Cmg//sizH/gVR0iuFH0nT10wRh/lDHPSexBU/B 3jtEo6GkTvasAOLLGxlEzrndMAzirLvx73XiDmUiVTqUzmwPjxwi8/NNRtEB5o/NqtRI dF7A== 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=aEq3Dbqv8gtP1jMXHF+Swd8Vbcs6FrBMld0EPxa/3F8=; b=FbrJbZA1+0NAq2r3OIExaDRoT07Z/JonLi+sC0V+z6TodhKMnOiIRPX+1he56RxtJ7 gjL1ngat8jRj6I1s/qfzKt9RRMcN0MpNfVH4Lt89MoNQK7CcTaDfY0xDTPYKm0LW0e9W zqPbLkxdXG/C86E4fhbe6QGqgC3cPQz0wIT/+mGCAyjDiVf2anO1GzgmtpmlEr+voPOZ xn4eGeCSlEWHSKdCkNuqSNR1dhvviXVBAdO4Yu9sDn6NGc4Hlq4Z2a/MlMr5YHZsV5TE cpF56agu0Hcwk/N3z7Zp5OkN++BCBQx83vScCm5n3fMqRCWzxX5UAsEUwBqwT9brIMxs pqCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp20si301970ejc.526.2022.01.26.14.34.38; Wed, 26 Jan 2022 14:35:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244455AbiAZTld (ORCPT + 99 others); Wed, 26 Jan 2022 14:41:33 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:43464 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbiAZTlc (ORCPT ); Wed, 26 Jan 2022 14:41:32 -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 9b1ad74b14709705; Wed, 26 Jan 2022 20:41:30 +0100 Received: from kreacher.localnet (unknown [213.134.162.63]) (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 DFC2F66B311; Wed, 26 Jan 2022 20:41:28 +0100 (CET) From: "Rafael J. Wysocki" To: Hans de Goede Cc: LKML , Linux ACPI , Andy Shevchenko , platform-driver-x86@vger.kernel.org, Mark Gross , Maximilian Luz Subject: [PATCH] platform: surface: Replace acpi_bus_get_device() Date: Wed, 26 Jan 2022 20:41:27 +0100 Message-ID: <5805278.lOV4Wx5bFT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.162.63 X-CLIENT-HOSTNAME: 213.134.162.63 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrfedugdduvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpefhgedtffejheekgeeljeevvedtuefgffeiieejuddutdekgfejvdehueejjeetvdenucfkphepvddufedrudefgedrudeivddrieefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeivddrieefpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeejpdhrtghpthhtohephhguvghgohgvuggvsehrvgguhhgrthdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhr tghpthhtohepphhlrghtfhhorhhmqdgurhhivhgvrhdqgiekieesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrghrkhhgrhhoshhssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehluhiimhgrgihimhhilhhirghnsehgmhgrihhlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 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/platform/surface/surface3-wmi.c | 12 ++++-------- drivers/platform/surface/surface_acpi_notify.c | 3 ++- 2 files changed, 6 insertions(+), 9 deletions(-) Index: linux-pm/drivers/platform/surface/surface3-wmi.c =================================================================== --- linux-pm.orig/drivers/platform/surface/surface3-wmi.c +++ linux-pm/drivers/platform/surface/surface3-wmi.c @@ -116,15 +116,11 @@ static acpi_status s3_wmi_attach_spi_dev void *data, void **return_value) { - struct acpi_device *adev, **ts_adev; + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); + struct acpi_device **ts_adev = data; - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; - - ts_adev = data; - - if (strncmp(acpi_device_bid(adev), SPI_TS_OBJ_NAME, - strlen(SPI_TS_OBJ_NAME))) + if (!adev || strncmp(acpi_device_bid(adev), SPI_TS_OBJ_NAME, + strlen(SPI_TS_OBJ_NAME))) return AE_OK; if (*ts_adev) { Index: linux-pm/drivers/platform/surface/surface_acpi_notify.c =================================================================== --- linux-pm.orig/drivers/platform/surface/surface_acpi_notify.c +++ linux-pm/drivers/platform/surface/surface_acpi_notify.c @@ -770,7 +770,8 @@ static acpi_status san_consumer_setup(ac return AE_OK; /* Ignore ACPI devices that are not present. */ - if (acpi_bus_get_device(handle, &adev) != 0) + adev = acpi_fetch_acpi_dev(handle); + if (!adev) return AE_OK; san_consumer_dbg(&pdev->dev, handle, "creating device link\n");