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: 133842 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp861087ljf; Thu, 19 Apr 2018 09:59:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49WDTvv+ewdsPyW3shWlqlzapdyLIN1cM+bkSqiPJZzWwchAW2OzAP/uJmhPD7OisdWsl2I X-Received: by 10.98.182.15 with SMTP id j15mr6522636pff.115.1524157147060; Thu, 19 Apr 2018 09:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524157147; cv=none; d=google.com; s=arc-20160816; b=OcOb8RcNuhJjP2xOuR+RyJz05prwrsVP2GCNITKpJuRoWAfyH3XFVyi7NV0MdXX1pO DKk5Uew9dgx5TyhBrAUvhHEsyQQiVevo6ahxrPX8W80uPKYsO+zHOccr6jPdxlqBYQAC QbWIp/8tppsQzpV7YPUbCp9g4zM58FlCkd5gULXZP5l+eOXqZYATmm3xyRkEpm6yCTZ4 MNK+AVgtkKwQlVQXCnPszp5IPnrcfcC3OLqdtLAc5OMufAML+KsWvMcj+AzBIYXNJh9x aKU3W4FdFXmloMAaYZghZ0yo1xgsagh2DxTl4Sn1YSfULgJ7f0n0nPx8bmhu1SVJpLIE AqKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=nA+ild2+EtmGwyBFPIiuhXi8N3dqPIQnw9SCXtEYPm0=; b=t1JUD5SkPIEScHmbdUH8YwoIFQ3HJH2dCsTf9WukAw9aL8htSP3+Lr/MIvWCK7R9cN aMPoDE7iHwtP01/ocxCvLuY2UzA4CM7lT9clom35L3reNRqC261GUqTsuXQXQagoYbbQ 6MNAi3SPo9nf/33Doen0oRB2CCjdtyU3xUNU9zxlvck1wFWso+rB8bf5+NUbzl8HMfxH 1dqjA5MTZY7yU8WDRz9kbU25X4MoFi/D2gda14o3aEM8apvcCW2eiisYazoHNzkM8sPq KAseSTX1cV2TluY2RzLO/ZNzHm4d4ff2LbS2oIpnFxuzblvcKiFcQSS+kGrGMiRwxVYR 7ODA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jpw4fpbS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si3130863pgu.535.2018.04.19.09.59.06; Thu, 19 Apr 2018 09:59:07 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=Jpw4fpbS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753335AbeDSQ7C (ORCPT + 29 others); Thu, 19 Apr 2018 12:59:02 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44894 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205AbeDSQ7A (ORCPT ); Thu, 19 Apr 2018 12:59:00 -0400 Received: by mail-wr0-f194.google.com with SMTP id o15-v6so15893929wro.11 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=XWvKPwHiJM8ng7oZM2rFMohSjy5YfeDKLE2zk7zwcusxbajMmr/TV/K8CREBFqEklG wj5SrDR96E4zEpUZwJQApdSzFR/9tDWAYZHlSZl2OG+sV+T5UFI+TsE2mtXz5XBSsArI C6EJHZAsIwh2naisWVw5uwJbrnO7FxBGjMJC/Xql2s0/0OqpaKM81wlrEBhTafooI+Qi xK0/I5DfUw06+bFvLySpT5FYDXagkVgznxV0CHH9tM83+Js9nPsHBxzUIB74l3h9v0i2 vGi1EKZGCdFLZUlfaXexv+6MBuoEq/ikO97U/fqpvChoc32NxYznWDQAyq66HA9pLZrR sglQ== X-Gm-Message-State: ALQs6tBHe+kl2CKH0F9sHqafHng1u8fUGJbmqUWFjbw8HKqoAC5WJ+rd OX/WTomfSO4rSxW29p3h9aQrXQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.0 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;