From patchwork Tue Aug 8 20:15:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 132876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2393313vqr; Tue, 8 Aug 2023 14:03:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7j+W4x7QWTPyN4fZKJp9J7TK/ikYTBahvrBU941UBOdEQ/bAk7pE9hhjdbKKxmsbK8mSV X-Received: by 2002:a05:6a00:1941:b0:680:f6fe:8908 with SMTP id s1-20020a056a00194100b00680f6fe8908mr672467pfk.9.1691528608612; Tue, 08 Aug 2023 14:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691528608; cv=none; d=google.com; s=arc-20160816; b=z1l6CO959wOSn1tpOgq4vl2UMAoErgZhInKxhW/0+kGw4/gsFcX9XsxOAkR+NalT5U lS8vO1SpLwqDU8yP9Iy3y4LZaVnybXU+FKlx+mg0rG2vYa5T5JLdaSAQvnU5s6xPSsQ/ kxKFZChDjoc+Lt/h1u27TFXt5tYv+urxR/pPujpzR/jLIUUpUJpG2p9GUNGdpQ43cmjq R6lemv1Gs8v03KtSfPuulWzK/OAud4QgY1ajvsSCbUvO67nl+KeBo6p5nWOnSKj78t/Z kXoJr/HR7/0AykgvbifJcPgK9BZEcCsP8sNw5gUfIxk8cN5GLH4ESDj/q0jWHLPrO6LU w1Ng== 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=TRemvQorxxwLa31Jj2BOgk2kFktllr9G9RFEASSUVyA=; fh=tRVF8+lda9bdQSEp/arj7/6sGCI/pAIJZbkBFLyPtrg=; b=ipTz3nh5fNKqtPIgjZES8nqiaoPRkEjlYTGNRuMpqJVzXQdLTSx4+rFPEc2e81Ju89 fR/u0PRWZZqtAa00uIqiw0Ef58oSLw7/jXsI41Qt9JafCrf7pT3rgKBFK1mP1XVC8UN4 PgefUQLetQMeZw0eE3VXiKX7qBuPHXdf1vvdDEe2rGgwQ6vRJ5HN/Sw01BL0B1WPPvwY 6Odv1GwHqEW1bl0I52wg7DM0FFOHDk3CLmI89HKhOBnPB+vwsw3pknWHJJ1WxgQYkKlR B7ifLYdR8nGdZv76v/JKyuHQwXLjQlepHFGgdEjRw8M3qhkwAaMOx7FejuZpax6aaFIQ Z+Yw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a056a001a4e00b00682850547a9si6361662pfv.201.2023.08.08.14.03.14; Tue, 08 Aug 2023 14:03:28 -0700 (PDT) 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 S233651AbjHHU65 (ORCPT + 99 others); Tue, 8 Aug 2023 16:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235709AbjHHUmd (ORCPT ); Tue, 8 Aug 2023 16:42:33 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D312711F7C; Tue, 8 Aug 2023 13:15:17 -0700 (PDT) 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.2.0) id 07c178e901b4681b; Tue, 8 Aug 2023 22:15:15 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=) 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 v370.home.net.pl (Postfix) with ESMTPSA id 0057166137E; Tue, 8 Aug 2023 22:15:14 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Zhang Rui , Srinivas Pandruvada , Linux PM Subject: [PATCH v1] ACPI: thermal: Do not attach private data to ACPI handles Date: Tue, 08 Aug 2023 22:15:15 +0200 Message-ID: <5703187.DvuYhMxLoT@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrledvgddugeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepffffffekgfehheffleetieevfeefvefhleetjedvvdeijeejledvieehueevueffnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomhdp rhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773696302309595815 X-GMAIL-MSGID: 1773696302309595815 From: Rafael J. Wysocki The ACPI thermal driver uses acpi_bus_attach_private_data() to attach the thermal zone object to the ACPI handle of the thermal zone and acpi_bus_detach_private_data() to clean that up, but it never uses acpi_bus_get_private_data() to retrieve that object. Drop the unneded acpi_bus_attach_private_data() and acpi_bus_detach_private_data() calls from the ACPI thermal driver and clean up the related code. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Zhang Rui --- drivers/acpi/thermal.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -742,7 +742,6 @@ static int acpi_thermal_register_thermal { int trips = 0; int result; - acpi_status status; int i; if (tz->trips.critical.valid) @@ -775,24 +774,15 @@ static int acpi_thermal_register_thermal if (result) goto unregister_tzd; - status = acpi_bus_attach_private_data(tz->device->handle, - tz->thermal_zone); - if (ACPI_FAILURE(status)) { - result = -ENODEV; - goto remove_links; - } - result = thermal_zone_device_enable(tz->thermal_zone); if (result) - goto acpi_bus_detach; + goto remove_links; dev_info(&tz->device->dev, "registered as thermal_zone%d\n", thermal_zone_device_id(tz->thermal_zone)); return 0; -acpi_bus_detach: - acpi_bus_detach_private_data(tz->device->handle); remove_links: acpi_thermal_zone_sysfs_remove(tz); unregister_tzd: @@ -806,7 +796,6 @@ static void acpi_thermal_unregister_ther acpi_thermal_zone_sysfs_remove(tz); thermal_zone_device_unregister(tz->thermal_zone); tz->thermal_zone = NULL; - acpi_bus_detach_private_data(tz->device->handle); }