Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1499285imu; Mon, 5 Nov 2018 22:49:00 -0800 (PST) X-Google-Smtp-Source: AJdET5cJCMn39/VMKSBBggg00e91CsfZvwcb/bTtrNTuGvuhhPBhRBVHuqiVla+15X46AJhmjKQE X-Received: by 2002:a17:902:ab83:: with SMTP id f3-v6mr19984057plr.122.1541486940858; Mon, 05 Nov 2018 22:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541486940; cv=none; d=google.com; s=arc-20160816; b=R0qjCuDpoXznuhOfPMQ0mmXo3EME+hf0oiDsJSeIBBkuN+5bq/TrKjXTGmh7rLmiDo F6tPeecutLgtspIbodYiPFPZAPGegCukpgWth+ihbMFEp8mc4wupOV5B9Gm/FtWZWg0n X+rBtEqlfqnf+AgOHjmLKVPE6FHVa3sMYVo57UQ9FZz00qh+v20YX9POy94BNjPxqi9m bqwIjh0zRiW3i/+HEO/yNJm8FIMbMr0QK6vtiM9D5xeU/+EZyoP2hnUIiLM/W/tbb5my 3d79NLu/lKLoDvDZP3lYaSkW2tnC5oaMmh1mXdIUvqDriPk8AgtA+T0RjU9zSAcC+6ug vyVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=a/cmwIbTjbvSU6tQW0JM8kX1jZTrMaVWy4je/hEaCXQ=; b=rrkXGunlvvFZoFzs5HzKDAK2vy6XGg3i6TvlmqNjpCanpmS5CNs5ZSoxKT/+aYirKm OLJc6vk6gHBHHtsLbhaTCK5393VRclvOn34N8KMJb4r9fu+e2Y2Mru9VsLDxF7ueJrvr lz/X9BoWxUQ82i6gk0NXMambVWZ1y9Q8lFYIaC3cgo9LxJvHP+PMjdV/tcVjBBUIUJ6v DnU44nH1P/wFzUn35mblzM1PyKCtOHGa3+TVy3EFLWvAtsjTuBk0Zef3qPOqHmmvQYcR iqIN2H7S7kdj70Ixur/kwtqGv5yRECHcQM8itYf/C7jn7xP1jAmSO5sF519y3qhSvMER mNvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si2110143pld.229.2018.11.05.22.48.46; Mon, 05 Nov 2018 22:49:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387579AbeKFQLD (ORCPT + 99 others); Tue, 6 Nov 2018 11:11:03 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:17402 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387551AbeKFQLD (ORCPT ); Tue, 6 Nov 2018 11:11:03 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id A22F32AC5F19ED3F0D67; Tue, 6 Nov 2018 14:47:18 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wA66lBav044660; Tue, 6 Nov 2018 14:47:11 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018110614472470-8886605 ; Tue, 6 Nov 2018 14:47:24 +0800 From: Peng Hao To: robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, gregkh@linuxfoundation.org, andy@infradead.org, dvhart@infradead.org Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, hutao@cn.fujitsu.com, linux-doc@vger.kernel.org, Peng Hao Subject: [PATCH V8 07/11] misc/pvpanic : break dependency on ACPI Date: Tue, 6 Nov 2018 22:57:18 +0800 Message-Id: <1541516242-98568-7-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1541516242-98568-1-git-send-email-peng.hao2@zte.com.cn> References: <1541516242-98568-1-git-send-email-peng.hao2@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-06 14:47:24, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-06 14:47:07, Serialize complete at 2018-11-06 14:47:07 X-MAIL: mse01.zte.com.cn wA66lBav044660 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pvpanic driver is available for architectures that do not support ACPI.So break the dependency. Reviewed-by: Andy Shevchenko Signed-off-by: Peng Hao --- drivers/misc/Kconfig | 2 +- drivers/misc/pvpanic.c | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 64c898a..642626a 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -515,7 +515,7 @@ config MISC_RTSX config PVPANIC tristate "pvpanic device support" - depends on ACPI + depends on ACPI || OF help This driver provides support for the pvpanic device. pvpanic is a paravirtualized device provided by QEMU; it lets a virtual machine diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c index a9676b7..83f3187 100644 --- a/drivers/misc/pvpanic.c +++ b/drivers/misc/pvpanic.c @@ -57,6 +57,7 @@ .priority = 1, /* let this called before broken drm_fb_helper */ }; +#ifdef CONFIG_ACPI static int pvpanic_add(struct acpi_device *device); static int pvpanic_remove(struct acpi_device *device); @@ -126,6 +127,24 @@ static int pvpanic_remove(struct acpi_device *device) return 0; } +static int pvpanic_register_acpi_driver(void) +{ + return acpi_bus_register_driver(&pvpanic_driver); +} + +static void pvpanic_unregister_acpi_driver(void) +{ + acpi_bus_unregister_driver(&pvpanic_driver); +} +#else +static int pvpanic_register_acpi_driver(void) +{ + return -ENODEV; +} + +static void pvpanic_unregister_acpi_driver(void) {} +#endif + static int pvpanic_mmio_probe(struct platform_device *pdev) { struct resource *mem; @@ -172,7 +191,7 @@ static int __init pvpanic_mmio_init(void) if (acpi_disabled) return platform_driver_register(&pvpanic_mmio_driver); else - return acpi_bus_register_driver(&pvpanic_driver); + return pvpanic_register_acpi_driver(); } static void __exit pvpanic_mmio_exit(void) @@ -180,7 +199,7 @@ static void __exit pvpanic_mmio_exit(void) if (acpi_disabled) platform_driver_unregister(&pvpanic_mmio_driver); else - acpi_bus_unregister_driver(&pvpanic_driver); + pvpanic_unregister_acpi_driver(); } module_init(pvpanic_mmio_init); -- 1.8.3.1