Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3153380pxv; Mon, 12 Jul 2021 10:31:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6IDg60/FSLuPJ7HQlBFNT+ePaIIhhozfhYJE+9jMsINfPBEVInbbbZSiieDngEXjlvM3s X-Received: by 2002:a17:907:3e9c:: with SMTP id hs28mr172213ejc.473.1626111068741; Mon, 12 Jul 2021 10:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626111068; cv=none; d=google.com; s=arc-20160816; b=gkLKWJojZdVZULwQKnF+D9I90U+ssDyAkuN87OaNg6j2VSIyDyX6E9bRUhXG5FGFBT G49+CT/9wDk0/FabvJyEevXq4gWqz4KmLSyU4LUc5i8+3FrOZnswJH04odaG9W7ebab0 AYt/Vj++rHBcEfmQxFmrbVtWgcSOwSnXfR3fJETtkiwu88kxyYGkUz+4ulb5V+yd8RHp rFtosMwUy+t8fTz+qgKD7CZMFYXeuQ/A74OH+pc4/YWAfy8TYg6ch6UIzvhp0+vcm033 5Ulqx7B9a7jstg6OQi0qbUvR0PjTCznioweaCLVN2KuUgH7u+fM5ZmxsMJnQauAMgl23 hMxw== 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=1aWEvK5E/6EtGMAnqCF1By9Oq8pbj9m0U83cyWSoVrQ=; b=gtLh9vniGKzNMaDjZ62tFc5tojwNDmL65NE47mcoVWF/yTeoTB/ict5Xmhsc+PFxnG RXFD3RX4bA9ZkBHrzFgYhpGWVbRS50t8rjVELPm4Lb1KhNCNdJRiTPnLkBcGiif32qq5 ebK2EjKobLlvA4QT6SseTkRpupu0HxD23GMZM1bF1Z6+V8QV6PJEqgxWz17QqF+pJd1q 2VNag6cEPPsQBGi+tbVb76i5T2De3G+yGyFTalfdKVKf+sZnxXdJizLw+NB9RymaGIM8 qYP4nRiVEwnmwzLFIia0HIGT4gluhHmzk2kv+q9EtFJvbx3Q5OnHeYejqGN3DrbpoR7Z SMZw== 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 ne40si11761108ejc.243.2021.07.12.10.30.44; Mon, 12 Jul 2021 10:31:08 -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 S235772AbhGLRbg (ORCPT + 99 others); Mon, 12 Jul 2021 13:31:36 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:45690 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235724AbhGLRbc (ORCPT ); Mon, 12 Jul 2021 13:31:32 -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 388f45206587b73e; Mon, 12 Jul 2021 19:28:42 +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 E0543669C37; Mon, 12 Jul 2021 19:28:41 +0200 (CEST) From: "Rafael J. Wysocki" To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , Andy Shevchenko , Linux ACPI , LKML , "Krogerus, Heikki" Subject: [PATCH v1 1/6] ACPI: glue: Rearrange acpi_device_notify() Date: Mon, 12 Jul 2021 19:23:32 +0200 Message-ID: <1860890.PYKUYFuaPT@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: gggruggvucftvghtrhhoucdtuddrgedvtddruddvgdduudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvjeelgffhiedukedtleekkedvudfggefhgfegjefgueekjeelvefggfdvledutdenucfkphepkeelrdeigedrkedvrdegheenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepihhnvghtpeekledrieegrdekvddrgeehpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehv 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 Make the code flow in acpi_device_notify() more straightforward and make it use dev_dbg() and acpi_handle_debug() for printing debug messages. The only expected functional impact of this change is the content of the debug messages printed by acpi_device_notify(). Signed-off-by: Rafael J. Wysocki --- drivers/acpi/glue.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) Index: linux-pm/drivers/acpi/glue.c =================================================================== --- linux-pm.orig/drivers/acpi/glue.c +++ linux-pm/drivers/acpi/glue.c @@ -292,22 +292,21 @@ static int acpi_device_notify(struct dev int ret; ret = acpi_bind_one(dev, NULL); - if (ret && type) { - struct acpi_device *adev; + if (ret) { + if (!type) + goto err; adev = type->find_companion(dev); if (!adev) { - pr_debug("Unable to get handle for %s\n", dev_name(dev)); + dev_dbg(dev, "ACPI companion not found\n"); ret = -ENODEV; - goto out; + goto err; } ret = acpi_bind_one(dev, adev); if (ret) - goto out; + goto err; } adev = ACPI_COMPANION(dev); - if (!adev) - goto out; if (dev_is_platform(dev)) acpi_configure_pmsi_domain(dev); @@ -317,16 +316,13 @@ static int acpi_device_notify(struct dev else if (adev->handler && adev->handler->bind) adev->handler->bind(dev); - out: - if (!ret) { - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; - - acpi_get_name(ACPI_HANDLE(dev), ACPI_FULL_PATHNAME, &buffer); - pr_debug("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer); - kfree(buffer.pointer); - } else { - pr_debug("Device %s -> No ACPI support\n", dev_name(dev)); - } + acpi_handle_debug(ACPI_HANDLE(dev), "Bound to device %s\n", + dev_name(dev)); + + return 0; + +err: + dev_dbg(dev, "No ACPI support\n"); return ret; }