Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3152599pxv; Mon, 12 Jul 2021 10:30:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd7ImMWTN7qmVt2whABdKm/ZDQiiy6N5bDJfrw22yMICrV0/OhBoVuuAzfOuyrX07Ik96J X-Received: by 2002:a05:6402:2044:: with SMTP id bc4mr38708164edb.307.1626111005329; Mon, 12 Jul 2021 10:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626111005; cv=none; d=google.com; s=arc-20160816; b=BEhzDOLgY5WM+8QIaGGWcbtX4s23BYnvMfPqu9SsqncyY5Ku39CdQgLlO7rk+RZlV4 U5WCBbGQ4ryq+GN+FcyJaWt1MJL8ZzdvCL5knh9h+4YDPPcR1ljZeHsdB6fmWa2k1c3Y JHbqSqtvopAIMa5u6Jt2hgiVcYvGNZS2zCi6Weye4lbgCb3ekfrPepruaFUCbgOGGspK s1ZJHQdojf8fzodx+HYQ1T3qYokeWfa/8MLJziLIsVeiRj+Nz7c1u6xm6jsj3q6t8wBh F7UbmpUNOD2pgaCok36ePTy6LM/jvIfA1lYKmHsR2Q1O6/HHz8en0le6P3j2OI49cUxL rPSg== 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=8lSz1W3CVvegC02fFIMSKICmiMnSQioEbPRuuBmV3lg=; b=1FGKuiCtTkuqekLBxV1+XNJ3w9T31tjXa3/lw3zHaokwi1hq4b9/yqH4llywDqiOGX VyPrYPCUXyQzhu2OrzlYEpgcE7j2GdjL/ARb9Iep2mNJl06KEx+iL8ziMn3HysTdNgVX c9g17aTkNlx4e54NGnKop/6P0QxnBeWBkH9dPj2bc6hV0S5Itm5NMXdpL4TklBN0/UdY zy5hX22QOkOT07e7BGiJruJAaaLPeX99vB9tCLXS6z4SinIXcBfov705uG1cGEdDF176 ifCPfgDOvjhnxi239hRANyQNjXzlZAs9uA5Tng+tD1Dp/YXZHokEJlWHHU0bHgEwr4AD W12w== 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 qt14si4714ejb.432.2021.07.12.10.29.41; Mon, 12 Jul 2021 10:30:05 -0700 (PDT) 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 S235707AbhGLRb2 (ORCPT + 99 others); Mon, 12 Jul 2021 13:31:28 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:50650 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235694AbhGLRb2 (ORCPT ); Mon, 12 Jul 2021 13:31:28 -0400 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 2.1.0) id ce6edfc1f50ac715; Mon, 12 Jul 2021 19:28:38 +0200 Received: from kreacher.localnet (89-64-82-45.dynamic.chello.pl [89.64.82.45]) (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 4DA1A669C37; Mon, 12 Jul 2021 19:28:37 +0200 (CEST) From: "Rafael J. Wysocki" To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , Andy Shevchenko , Linux ACPI , LKML , "Krogerus, Heikki" Subject: [PATCH v1 4/6] ACPI: glue: Eliminate acpi_platform_notify() Date: Mon, 12 Jul 2021 19:25:55 +0200 Message-ID: <8790139.CDJkKcVGEf@kreacher> In-Reply-To: <2780027.e9J7NaK4W3@kreacher> References: <2780027.e9J7NaK4W3@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 89.64.82.45 X-CLIENT-HOSTNAME: 89-64-82-45.dynamic.chello.pl X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddruddvgdduudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvjeelgffhiedukedtleekkedvudfggefhgfegjefgueekjeelvefggfdvledutdenucfkphepkeelrdeigedrkedvrdegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeekledrieegrdekvddrgeehpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehv ghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephhgvihhkkhhirdhkrhhoghgvrhhusheslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Get rid of acpi_platform_notify() which is redundant and make device_platform_notify() in the driver core call acpi_device_notify() and acpi_device_notify_remove() directly. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/glue.c | 19 ++----------------- drivers/base/core.c | 7 ++++--- include/linux/acpi.h | 10 ++++------ 3 files changed, 10 insertions(+), 26 deletions(-) Index: linux-pm/drivers/base/core.c =================================================================== --- linux-pm.orig/drivers/base/core.c +++ linux-pm/drivers/base/core.c @@ -2005,9 +2005,10 @@ device_platform_notify(struct device *de { int ret; - ret = acpi_platform_notify(dev, action); - if (ret) - return ret; + if (action == KOBJ_ADD) + acpi_device_notify(dev); + else if (action == KOBJ_REMOVE) + acpi_device_notify_remove(dev); ret = software_node_notify(dev, action); if (ret) Index: linux-pm/include/linux/acpi.h =================================================================== --- linux-pm.orig/include/linux/acpi.h +++ linux-pm/include/linux/acpi.h @@ -1380,13 +1380,11 @@ static inline int find_acpi_cpu_cache_to #endif #ifdef CONFIG_ACPI -extern int acpi_platform_notify(struct device *dev, enum kobject_action action); +extern void acpi_device_notify(struct device *dev); +extern void acpi_device_notify_remove(struct device *dev); #else -static inline int -acpi_platform_notify(struct device *dev, enum kobject_action action) -{ - return 0; -} +static inline void acpi_device_notify(struct device *dev) { } +static inline void acpi_device_notify_remove(struct device *dev) { } #endif #endif /*_LINUX_ACPI_H*/ Index: linux-pm/drivers/acpi/glue.c =================================================================== --- linux-pm.orig/drivers/acpi/glue.c +++ linux-pm/drivers/acpi/glue.c @@ -285,7 +285,7 @@ int acpi_unbind_one(struct device *dev) } EXPORT_SYMBOL_GPL(acpi_unbind_one); -static void acpi_device_notify(struct device *dev) +void acpi_device_notify(struct device *dev) { struct acpi_bus_type *type = acpi_get_bus_type(dev); struct acpi_device *adev; @@ -324,7 +324,7 @@ err: dev_dbg(dev, "No ACPI support\n"); } -static void acpi_device_notify_remove(struct device *dev) +void acpi_device_notify_remove(struct device *dev) { struct acpi_device *adev = ACPI_COMPANION(dev); struct acpi_bus_type *type; @@ -340,18 +340,3 @@ static void acpi_device_notify_remove(st acpi_unbind_one(dev); } - -int acpi_platform_notify(struct device *dev, enum kobject_action action) -{ - switch (action) { - case KOBJ_ADD: - acpi_device_notify(dev); - break; - case KOBJ_REMOVE: - acpi_device_notify_remove(dev); - break; - default: - break; - } - return 0; -}