From patchwork Tue May 30 15:44:40 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: 100950 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2277581vqr; Tue, 30 May 2023 08:46:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6w7vY7p0DSEvS/t0VqkWwRdjylz882IaXRK+wuNRydppDbZGFCsDLR8yD/ZiyFEZKiHJBu X-Received: by 2002:a05:6a21:3416:b0:102:5f75:91ea with SMTP id yn22-20020a056a21341600b001025f7591eamr2623401pzb.47.1685461613434; Tue, 30 May 2023 08:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685461613; cv=none; d=google.com; s=arc-20160816; b=x7uMfqciv1RCtH+QYIBJ3Txy0un2Ysile47342XvhRtMeeoVQCQC3GSRrkIH5p4zhl 2Pd/fRUCVaBDaaxWLeHY+MmlredDVuIo48C/no+I7jemtxE++TmXABDiC4RIYQpGlzsp 65sFBZvoKDbmHWQ0daF24vefWiegnWb6UFVCDDI9DebKxMKue601cLKzT2sH99JUro+X u/pV+3/13+N2C6jd456xBfKK68vZZ3u/+W+Z4TMWZnpxqI+NF3XBUjdd8XdquOrKM+qG MhtUfxR00/Ro5bJ9wzrMDl27Fd/d8FfQVVN8sqODemX/JigGv5gCFFtJqUgVn11WzY1M vgtA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CukBp8WrliqDU5pzJ5r6ElW1MfHzOyM2HJFfu67XowM=; b=j2Uxl9xCqiPPfS53PLh2ObOAvxZ4Oh/jx0jtnr18SzQbuD6Fmxm082aJr9SRx+9AIT cHQEvOvqP7un5b1kl9nKWAzkyrGdWVqAYx53od8bsUP9RSxhjKb48M/tvQGWHp2sO/FV bCb75vjvk4QzScactC+dkuNpe9rVAK5x3xGHI9HIIr3OJrf9V09bja+kr1L7RcEzKopt VikwxyitSsbz8V9z/BECrgYFh7WTMejWYu5QEszuJ4BWWTQX4LGlUg340S98ELfAO3qG hlnlhKzwwj0CIGkTOEh0fmoGKZoQotlY4t5GUc/D7aqM3d4aLNQeZ6RDLxoorDQ/hjiM TtdA== 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 a29-20020a631a5d000000b0053ba833a8bfsi6321747pgm.531.2023.05.30.08.46.40; Tue, 30 May 2023 08:46:53 -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 S232323AbjE3PqI (ORCPT + 99 others); Tue, 30 May 2023 11:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbjE3PqF (ORCPT ); Tue, 30 May 2023 11:46:05 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03FFEC7; Tue, 30 May 2023 08:46:00 -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 b5dd397e3628a3f2; Tue, 30 May 2023 17:45:59 +0200 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 D8F848BB094; Tue, 30 May 2023 17:45:58 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Zhang Rui , Daniel Lezcano , Michal Wilczynski Subject: [PATCH v1 4/5] ACPI: thermal: Move acpi_thermal_driver definition Date: Tue, 30 May 2023 17:44:40 +0200 Message-ID: <21889638.EfDdHjke4D@kreacher> In-Reply-To: <5675481.DvuYhMxLoT@kreacher> References: <5675481.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: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekjedgleduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehm ihgthhgrlhdrfihilhgtiiihnhhskhhisehinhhtvghlrdgtohhm 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,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767334596774479772?= X-GMAIL-MSGID: =?utf-8?q?1767334596774479772?= From: Rafael J. Wysocki Move the definition of the acpi_thermal_driver structure closer to the initialization code that registes the driver, so some function forward declarations can be dropped. Also move the module information to the end of the file where it is usually located. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Michal Wilczynski --- drivers/acpi/thermal.c | 66 +++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -70,10 +70,6 @@ do { \ "Please report to linux-acpi@vger.kernel.org\n", str); \ } while (0) -MODULE_AUTHOR("Paul Diefenbaugh"); -MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); -MODULE_LICENSE("GPL"); - static int act; module_param(act, int, 0644); MODULE_PARM_DESC(act, "Disable or override all lowest active trip points."); @@ -100,37 +96,6 @@ MODULE_PARM_DESC(psv, "Disable or overri static struct workqueue_struct *acpi_thermal_pm_queue; -static int acpi_thermal_add(struct acpi_device *device); -static void acpi_thermal_remove(struct acpi_device *device); -static void acpi_thermal_notify(struct acpi_device *device, u32 event); - -static const struct acpi_device_id thermal_device_ids[] = { - {ACPI_THERMAL_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, thermal_device_ids); - -#ifdef CONFIG_PM_SLEEP -static int acpi_thermal_suspend(struct device *dev); -static int acpi_thermal_resume(struct device *dev); -#else -#define acpi_thermal_suspend NULL -#define acpi_thermal_resume NULL -#endif -static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, acpi_thermal_suspend, acpi_thermal_resume); - -static struct acpi_driver acpi_thermal_driver = { - .name = "thermal", - .class = ACPI_THERMAL_CLASS, - .ids = thermal_device_ids, - .ops = { - .add = acpi_thermal_add, - .remove = acpi_thermal_remove, - .notify = acpi_thermal_notify, - }, - .drv.pm = &acpi_thermal_pm, -}; - struct acpi_thermal_state { u8 critical:1; u8 hot:1; @@ -1131,6 +1096,33 @@ static int acpi_thermal_resume(struct de } #endif +static const struct acpi_device_id thermal_device_ids[] = { + {ACPI_THERMAL_HID, 0}, + {"", 0}, +}; +MODULE_DEVICE_TABLE(acpi, thermal_device_ids); + +#ifdef CONFIG_PM_SLEEP +static int acpi_thermal_suspend(struct device *dev); +static int acpi_thermal_resume(struct device *dev); +#else +#define acpi_thermal_suspend NULL +#define acpi_thermal_resume NULL +#endif +static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, acpi_thermal_suspend, acpi_thermal_resume); + +static struct acpi_driver acpi_thermal_driver = { + .name = "thermal", + .class = ACPI_THERMAL_CLASS, + .ids = thermal_device_ids, + .ops = { + .add = acpi_thermal_add, + .remove = acpi_thermal_remove, + .notify = acpi_thermal_notify, + }, + .drv.pm = &acpi_thermal_pm, +}; + static int thermal_act(const struct dmi_system_id *d) { if (act == 0) { pr_notice("%s detected: disabling all active thermal trip points\n", @@ -1235,3 +1227,7 @@ static void __exit acpi_thermal_exit(voi module_init(acpi_thermal_init); module_exit(acpi_thermal_exit); + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); +MODULE_LICENSE("GPL");