From patchwork Fri Dec 3 16:34:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 520194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 315A7C433EF for ; Fri, 3 Dec 2021 16:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382131AbhLCQlG (ORCPT ); Fri, 3 Dec 2021 11:41:06 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:64874 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382094AbhLCQk6 (ORCPT ); Fri, 3 Dec 2021 11:40:58 -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 3.0.1) id 6059d5042bbcf878; Fri, 3 Dec 2021 17:37:33 +0100 Received: from kreacher.localnet (unknown [213.134.175.202]) (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 38ED566AD69; Fri, 3 Dec 2021 17:37:32 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Andy Shevchenko , Hans de Goede , Mika Westerberg , LKML , Sakari Ailus Subject: [PATCH 0/2] ACPI: scan: Introduce a replacement for acpi_bus_get_device() Date: Fri, 03 Dec 2021 17:34:58 +0100 Message-ID: <2828957.e9J7NaK4W3@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.175.202 X-CLIENT-HOSTNAME: 213.134.175.202 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrieejgdelfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhephfegtdffjeehkeegleejveevtdeugfffieeijeduuddtkefgjedvheeujeejtedvnecukfhppedvudefrddufeegrddujeehrddvtddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudejhedrvddtvddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohephhguvghgohgvuggvsehrvgguhhgrthdrtghomhdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhi nhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi All, Because acpi_bus_get_device() turned out to be problematic in the past, it has been changed to the point that its calling convention doesn't make much sense any more (ie. the pointer passed to it as the second argument is cleared on errors and it can only return one error value if that pointer is nonzero, so there is some duplication of information in there) and it has to make redundant checks. Moreover, its name suggests some kind of reference counting which really isn't the case. Thus patch [1/2] introduces a replacement for it, called acpi_fetch_acpi_dev(), and makes the code in scan.c use it instead of acpi_bus_get_device() internally. Patch [2/2] updates all of the callers of acpi_bus_get_device() within the ACPI subsystem to use the replacement (which involves fixing a couple of bugs related to that). Thanks! Reviewed-by: Hans de Goede Reviewed-by: Mika Westerberg