Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp445774iog; Mon, 13 Jun 2022 06:08:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEkx4JwLNHlSS0PKcHqHpecfHeUOMhFUSjW1LBiulqd9tgI8uHQPwfay4n86SjwwY8B7S2 X-Received: by 2002:a17:902:ed82:b0:158:fef8:b501 with SMTP id e2-20020a170902ed8200b00158fef8b501mr57005800plj.47.1655125708525; Mon, 13 Jun 2022 06:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125708; cv=none; d=google.com; s=arc-20160816; b=psmxTxytQPL9mjiqvdJ5yae8Bio5nlP94w3JJks54VPn+sjgYA59e8nfX/IBY3wK/+ hAMMtsbzAsc9N9bfheXpsssszyDG/IfJayP2jqOcvRRto6UvVlieeuyqsfpoRph1Dso4 1Q1C0kY6vvxoMjecd6MhXGvRTBBJvwClVo77pIgEiuuGPKgqYY1Sovj7Bq3DT1hIXrqu l0Sjx0EqLohxju1MH2kACM3IIDtNzyOxE/3HUrFRoZcs2TGPPTz2EHgNGljCLmJ3IxfI jYYPJt7VsVu3s9l/eWmjJSEQUJuFya9LXbUYiQHm/9uGoVN0v4TEUScRi99CAKtq0gcz EWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/9/UOod5x2K5gb2phe38bcnkoGZ2GVxHjnMxmhQN1bE=; b=kKIsi1Zo6CVoyht/LU5FNqbG+naOO/llUOOuAmywRys1qHZhXO6GxOz/0R5b+E6JHM ffqIuEVJjQpYxN3t3foRmqPv6GEkqwBiCXzYRybB4BCIl/MwIdntVEWpGyymKX019Orb pG5fgE3dGtD6kuiAW0DKnvQurLBOM0MK2vYpEIt4MfQpr67WYIIUtaaB5ofJ3qLdKwXJ tc3K5ZNegPdeKs/yNT+lS510+ZTPvCxPgClE0gdXH0Zlabwef1OB8mKraDsKZG7pdTHC 3PJSGbpEPSHNxQ3Q0V/1k2EKxf7f5HzwTnoAs5sS2XBc9O3Z2blIudDMr3G8/l5m/+Ys aQDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SyB0LjkA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a170902d4c300b001640bf93e63si11164444plg.206.2022.06.13.06.08.13; Mon, 13 Jun 2022 06:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SyB0LjkA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242214AbiFMKTP (ORCPT + 99 others); Mon, 13 Jun 2022 06:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241981AbiFMKRz (ORCPT ); Mon, 13 Jun 2022 06:17:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A441FCFD; Mon, 13 Jun 2022 03:15:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2CE3614BA; Mon, 13 Jun 2022 10:15:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6561C34114; Mon, 13 Jun 2022 10:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115352; bh=vntpavaEvCAcmLwBOToX8dhrXEvDIiR4LI1EkPjzj8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SyB0LjkACV3RcBEUvkXdrcoYX6LarPVjyOoGTsxRuEwiRpt4ewGAhsaLDX3q0bdAn shuQTAZ2Cds4/H/Tax9/MpGzVPRY3IE1yltp5s7PeqKmATGDowQmMMsEtkMb+kneJd MLWXUkM61XtiZtNVYX/Y4D+Jk7HP3dW/Eu776O90= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Finn Thain , Randy Dunlap , Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 035/167] macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled Date: Mon, 13 Jun 2022 12:08:29 +0200 Message-Id: <20220613094849.073556360@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Finn Thain [ Upstream commit 86ce436e30d86327c9f5260f718104ae7b21f506 ] drivers/macintosh/via-pmu-event.o: In function `via_pmu_event': via-pmu-event.c:(.text+0x44): undefined reference to `input_event' via-pmu-event.c:(.text+0x68): undefined reference to `input_event' via-pmu-event.c:(.text+0x94): undefined reference to `input_event' via-pmu-event.c:(.text+0xb8): undefined reference to `input_event' drivers/macintosh/via-pmu-event.o: In function `via_pmu_event_init': via-pmu-event.c:(.init.text+0x20): undefined reference to `input_allocate_device' via-pmu-event.c:(.init.text+0xc4): undefined reference to `input_register_device' via-pmu-event.c:(.init.text+0xd4): undefined reference to `input_free_device' make[1]: *** [Makefile:1155: vmlinux] Error 1 make: *** [Makefile:350: __build_one_by_one] Error 2 Don't call into the input subsystem unless CONFIG_INPUT is built-in. Reported-by: kernel test robot Signed-off-by: Finn Thain Tested-by: Randy Dunlap Reviewed-by: Christophe Leroy Acked-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5edbe76ce68227f71e09af4614cc4c1bd61c7ec8.1649326292.git.fthain@linux-m68k.org Signed-off-by: Sasha Levin --- drivers/macintosh/Kconfig | 4 ++++ drivers/macintosh/Makefile | 3 ++- drivers/macintosh/via-pmu.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index d28690f6e262..9e226e143473 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig @@ -87,6 +87,10 @@ config ADB_PMU this device; you should do so if your machine is one of those mentioned above. +config ADB_PMU_EVENT + def_bool y + depends on ADB_PMU && INPUT=y + config ADB_PMU_LED bool "Support for the Power/iBook front LED" depends on ADB_PMU diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile index 383ba920085b..8513c8aa2faf 100644 --- a/drivers/macintosh/Makefile +++ b/drivers/macintosh/Makefile @@ -11,7 +11,8 @@ obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o obj-$(CONFIG_INPUT_ADBHID) += adbhid.o obj-$(CONFIG_ANSLCD) += ans-lcd.o -obj-$(CONFIG_ADB_PMU) += via-pmu.o via-pmu-event.o +obj-$(CONFIG_ADB_PMU) += via-pmu.o +obj-$(CONFIG_ADB_PMU_EVENT) += via-pmu-event.o obj-$(CONFIG_ADB_PMU_LED) += via-pmu-led.o obj-$(CONFIG_PMAC_BACKLIGHT) += via-pmu-backlight.o obj-$(CONFIG_ADB_CUDA) += via-cuda.o diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 32c696799300..9bdb7d2055b1 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -1439,7 +1439,7 @@ pmu_handle_data(unsigned char *data, int len) pmu_pass_intr(data, len); /* len == 6 is probably a bad check. But how do I * know what PMU versions send what events here? */ - if (len == 6) { + if (IS_ENABLED(CONFIG_ADB_PMU_EVENT) && len == 6) { via_pmu_event(PMU_EVT_POWER, !!(data[1]&8)); via_pmu_event(PMU_EVT_LID, data[1]&1); } -- 2.35.1