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: 10351361 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 7D2116053C for ; Thu, 19 Apr 2018 16:59:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F570206AC for ; Thu, 19 Apr 2018 16:59:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 640A1219AC; Thu, 19 Apr 2018 16:59:12 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E07C206AC for ; Thu, 19 Apr 2018 16:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbeDSQ7B (ORCPT ); Thu, 19 Apr 2018 12:59:01 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40426 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753230AbeDSQ7A (ORCPT ); Thu, 19 Apr 2018 12:59:00 -0400 Received: by mail-wr0-f194.google.com with SMTP id v60-v6so15890310wrc.7 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=Kbhw2SGs6cFCFhJIfO6J86/qEvfo1zmznbdO/fdOON9sW0Nz96EkE43fJiviS1t9pU fSWSq87FXa0u6fC0JawTi+v7R1aiBDrHLv48OGzV/NGIgcgiI0i8FQsbm7vWXqTULow8 wnP7UXGWpfATjR+jj3IK03Zw4ke9gu7ObIysY8/IpWEKKWx/LuXX5nRUPQ3UPsoN2g6w yubagsX/fL8/JF3DJmTXk0QxlQRPjasRTSyH5Jv4CgJRTX0seAgZ/g7wGKdwyZxbELPP QUYWHI26NF3g3s6GGciq+vmFwILkzHM5KgRWMlYgyd6QgWQXDMSFT9m7eC9wTz/d6j+Q dCNg== X-Gm-Message-State: ALQs6tAtGx4Q1WWRuCPOUSbR+DS0jRgzIvU2cm7hWtVUiqDRCANIUWM5 ixJQQhitHSNI29RY8po3+1ytgQ== 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 Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, broonie@kernel.org, lorenzo.pieralisi@arm.com, bill.fletcher@linaro.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel 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 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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;