From patchwork Thu Apr 19 16:58:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10351363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 475B6602B7 for ; Thu, 19 Apr 2018 16:59:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38AB0205F7 for ; Thu, 19 Apr 2018 16:59:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D56D21327; Thu, 19 Apr 2018 16:59:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5FD8206AC for ; Thu, 19 Apr 2018 16:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=76yTI26i9TGoTCFXjVAVBbWXiNynXduJsSQBCblle6Q=; b=ioQ 3avoDbdKPP1O7UR3g0ecN2RqI6wC+H3guc+vQSWFoliyEFjuF2jr2KtNNPtOIzAiwyIaHKQ90IRRN tdq8R4O3YX2Nu4Sj+s/xQeOaAEtu3gzNUl+btPBNsgLbRvmoEP9yhBGKapBGSFXgCqLWjixxWfdeY wNT/g3lXM2yR/JpmCgvrzUnHlPX2ANQF7MhhuGnHGH9X8qyVV2EAXux+hM6sijw647DgHonWDjnzK z6DeqFDO83tYx/skDJB94ZzddXWsfLFGNBcLkD9CR8nUSOkCDzGkDns9vdCzB0aLwWuyx/7L6gSY3 YPwQGIF0cp3bD/lLi1ZTxDaBFW12dng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9Ctv-0003cb-JD; Thu, 19 Apr 2018 16:59:15 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9Ctr-0003as-C9 for linux-arm-kernel@lists.infradead.org; Thu, 19 Apr 2018 16:59:12 +0000 Received: by mail-wr0-x241.google.com with SMTP id f14-v6so15911197wre.4 for ; Thu, 19 Apr 2018 09:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=nA+ild2+EtmGwyBFPIiuhXi8N3dqPIQnw9SCXtEYPm0=; b=Jpw4fpbS4YGubi8o1+2dUq0wms7V91x9iNG8WN/lVWk2e/GBr4pFrz7O2285fGh4Ab JKVFF2vKCi63/kxL4hsqq98FWvbaT7HoGsjacy+3WKBadcKW57k7rU0Lf9LE++rE1F/h 2q7UGNAWWjC2yYk2W8EbLnpKiWjudPFExn0Kk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nA+ild2+EtmGwyBFPIiuhXi8N3dqPIQnw9SCXtEYPm0=; b=isTjw7WApO1qFIXNUxUUSrfZRFrGivAxazBarHZWkI7mb2wy8eEhOweQa78Hh8oY6T TRwa8SF4sv3oChfpeWQTu892budDgpA0aBs6l8x+yxyZBxZURNZX4UAk6FUFJ4gMy6G0 kTEd5Do3znTpAraP/HBgtRWvG55Wrze+3jRojACi1GM/3VQy2glFGP4iDM3S5HGnCfUu yOJ50uP8JlgeaBlSMrIqyQXjQliAq9rZJpdvzWQBQdcLxeGYU1uK90hJEe/JINQ0uqTp RzMQhuDOu65sd4w+VwKCEbV/D8rXw9kJNrUUVLHKOMPMAUbz1wKZdyEof3H6P2C6mihA bShg== X-Gm-Message-State: ALQs6tD0kPT5bafcBjPh7lrkXNYBqF0kYdaC9EqmMfbhPi8kFGIj8YFS Vv4YkTCfssx8mHoTlTLtZX1g5w== X-Google-Smtp-Source: AIpwx4/XtnxX7xD4K5qB0eIQ6YbriMCmrytXi1s8S7czD4v0iOKKI8/IzoQJ7sRK+ObBfqnnOJNzjQ== X-Received: by 10.28.134.69 with SMTP id i66mr1500457wmd.40.1524157139347; Thu, 19 Apr 2018 09:58:59 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id k30-v6sm9686448wrf.1.2018.04.19.09.58.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 09:58:58 -0700 (PDT) From: Ard Biesheuvel To: rjw@rjwysocki.net Subject: [PATCH] ACPI / bus: ignore rather than fail bus driver registrations on non-ACPI boot Date: Thu, 19 Apr 2018 18:58:25 +0200 Message-Id: <20180419165825.13008-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180419_095911_423512_49F7E65E X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bill.fletcher@linaro.org, lorenzo.pieralisi@arm.com, arnd@arndb.de, Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, broonie@kernel.org, linux-arm-kernel@lists.infradead.org, lenb@kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When building ACPI bus drivers such as button.ko into the core kernel, other drivers that depend on its symbols are loadable even when booting with ACPI disabled. For instance, nouveau.ko has a link time dependency on acpi_lid_open() on ACPI capable kernels, and calls it regardless of whether the system booted via ACPI. However, when building button.ko as a module, it will refuse to load if the system did not boot in ACPI mode, which subsequently prevents the nouveau driver from loading as well, resulting in broken graphics. Given that returning an error from an initcall() is ignored for drivers that are built into the kernel, let's align the module case with this, and not return an error when registering an ACPI bus driver on a system that did not boot via ACPI. Signed-off-by: Ard Biesheuvel --- drivers/acpi/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 84b4a62018eb..529d3d496fab 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -880,7 +880,7 @@ int acpi_bus_register_driver(struct acpi_driver *driver) int ret; if (acpi_disabled) - return -ENODEV; + return 0; driver->drv.name = driver->name; driver->drv.bus = &acpi_bus_type; driver->drv.owner = driver->owner;