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 A2668C05027 for ; Thu, 9 Feb 2023 12:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229898AbjBIMRD (ORCPT ); Thu, 9 Feb 2023 07:17:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjBIMQt (ORCPT ); Thu, 9 Feb 2023 07:16:49 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EBE19EB4A; Thu, 9 Feb 2023 04:16:30 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id B424120C8AEE; Thu, 9 Feb 2023 04:15:43 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B424120C8AEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675944943; bh=i1p50TI+7fOgk4LW62buuCzlHOInl+oROOTdYyM1xe0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=R45l2RjlJuLHuNwf4WONyHHr7T+kRK6l5zCqx/yYfKrb1R2/eigbHgmD6zqWhOFl3 sltSm2pidcN4VNi6j9iT4lMkklpiK8zqstWEO2chSL6SL81tbs+zK7SGDPP26hnxc/ UIl+MdjWxFPHmIu87aPIgyFILzzgSdHJk7YU2erI= From: Saurabh Sengar To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, virtualization@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@linux.microsoft.com, dphadke@linux.microsoft.com Subject: [PATCH v5 2/5] Drivers: hv: allow non ACPI compilation for hv_is_hibernation_supported Date: Thu, 9 Feb 2023 04:15:36 -0800 Message-Id: <1675944939-22631-3-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1675944939-22631-1-git-send-email-ssengar@linux.microsoft.com> References: <1675944939-22631-1-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org acpi_sleep_state_supported() currently is defined only when CONFIG_ACPI=y. For future work to enable device tree builds, put this function under #ifdef CONFIG_ACPI. Otherwise, return 'false' from hv_is_hibernation_supported() as Hyper-V guest configs using device tree don't support hibernation. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley --- drivers/hv/hv_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index 52a6f89ccdbd..370ec20d1993 100644 --- a/drivers/hv/hv_common.c +++ b/drivers/hv/hv_common.c @@ -234,7 +234,11 @@ EXPORT_SYMBOL_GPL(hv_setup_dma_ops); bool hv_is_hibernation_supported(void) { +#ifdef CONFIG_ACPI return !hv_root_partition && acpi_sleep_state_supported(ACPI_STATE_S4); +#else + return false; +#endif } EXPORT_SYMBOL_GPL(hv_is_hibernation_supported); -- 2.34.1