Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1895459pxp; Mon, 21 Mar 2022 07:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5gCCTnH0T0vlaHNUPGfNO9vsxBLg4EPicX5Y3G5GSJvUM58c3iB2emL51vMViGIawJjk8 X-Received: by 2002:a17:90b:1b4f:b0:1c6:d91b:9d0 with SMTP id nv15-20020a17090b1b4f00b001c6d91b09d0mr12552258pjb.72.1647872009811; Mon, 21 Mar 2022 07:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647872009; cv=none; d=google.com; s=arc-20160816; b=DW6cU3wWUB6uzFyZCxAP4gNH1m+whYi6fKXsYiaQRMp0tK7N1MoHV0qTOpswRMnaJg ACHRUKwdk0eDVYKIM/PoiJQMnf1sBuKlex6tM3q/aVtbqsPnEDKxfzsIVAQh0EhovP/o OHij7Pm6hAO/xNVKpOfsBUGoTSUFWWx6fh4exoEodvt8iiklv1bbq2uVslbb/ye3rKEQ dTdjxw7XQbV0YHKJaZmekr1WCVdq0DhS3bNIh5xz5CoWHODwl+HfbV5OPZtCotEf3EiZ pJhkaFFZDVErzSrvdT0jB/CHKvrZ774XVU7CruwWf6B5zDSqlfEBXIpiIsq5NNDfPwFT P7Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:subject:from:message-id:cc:to :dkim-signature; bh=q/rwdsZ9GX/6TRc6IpzD6MxELSkwdXgINKIVSJHbvoo=; b=yfc0EnaQRcgRtGnEEBVivuUDlHGwScWRl3Qf76IGNqZvxiECqnLWjMMCJ6z7riZxPO 1tPSICEuEAvAwdzylBswlB3GBRhoIkqBvIfNdrFrnW7pP6PBOVBNIcxVFS0X/ZxfZMwm rS5iLyph/3YR9OHMAHkVW0fohff3YPzvXkIXapQU8lAnO/D0axQjUUw2RdO4exWpOB2S SW0QTD8I+6Mp8VEDaopI7NPJVZEFLHyl5WwGoLDRRBZx6exbuvVNwPrzkKKo99v27mWU qz7kWX+Jqxq+5RCQWZ11PRsS9ZfTTvdoqGt3gOlhRf3ZewGQxQFNSUu7rL5Jw5RClR5U TvAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=h6F6rsLr; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd6-20020a656e06000000b003826cc35e62si4958440pgb.497.2022.03.21.07.13.15; Mon, 21 Mar 2022 07:13:29 -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=@messagingengine.com header.s=fm3 header.b=h6F6rsLr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344408AbiCUEdP (ORCPT + 99 others); Mon, 21 Mar 2022 00:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344398AbiCUEdK (ORCPT ); Mon, 21 Mar 2022 00:33:10 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8038E33E04 for ; Sun, 20 Mar 2022 21:31:29 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 726FE5C0126; Mon, 21 Mar 2022 00:31:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 21 Mar 2022 00:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:date:date:from:from:in-reply-to :message-id:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=q/rwds Z9GX/6TRc6IpzD6MxELSkwdXgINKIVSJHbvoo=; b=h6F6rsLrkM49LK8naaPQFf jmtqZkVdkqmcyMr4bXXeDugsLCcVGu86AtOlAFLmyEx7mAWegcgTWAJtSoWNQUMz airESWElgb83a15nivXWJ0F48Jrb3dxBJUuxwOW1YRgyVwVSbVx7LPFqyhL3g9xz bEYSNF1JP1oWjITMieaNiAwyNN1L0I/qt29MomnJ7g1BZ/mgDnIkFVb4KBEACWxK mpazMvWTffuAOTVjES7Njh6/bJFhto5t4/1R9+7RwKhfuKwvocBJ6+/xfgz9s0QK Kuuku9MEWuk97E7pDAK0Mq3mxIg8VoXrFyZ1sIamiKNTzDzh0a0+s6Qv4SaSPZsw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepvffkhffuffestddtredttddttdenucfhrhhomhephfhinhhnucfvhhgrihhn uceofhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgheqnecuggftrfgrthhtvghrnh eptdelteekleekkedvueejheekgfdvtdehhefhteeitefhteefgefhudehveevleelnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhthhgrih hnsehlihhnuhigqdhmieekkhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Mar 2022 00:31:24 -0400 (EDT) To: Benjamin Herrenschmidt Cc: "Michael Ellerman" , "Geert Uytterhoeven" , "Randy Dunlap" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Message-Id: From: Finn Thain Subject: [PATCH] macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled Date: Mon, 21 Mar 2022 15:30:28 +1100 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,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 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 Cc: Michael Ellerman Cc: Geert Uytterhoeven Cc: Randy Dunlap Signed-off-by: Finn Thain --- This is equivalent to the patch I sent a couple of days ago. This one is slightly longer and adds a new symbol so that Kconfig logic can been used instead of Makefile logic in case reviewers prefer that. --- drivers/macintosh/Kconfig | 5 +++++ drivers/macintosh/Makefile | 3 ++- drivers/macintosh/via-pmu.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index 5cdc361da37c..b9102f051bbb 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig @@ -67,6 +67,11 @@ config ADB_PMU this device; you should do so if your machine is one of those mentioned above. +config ADB_PMU_EVENT + bool + depends on ADB_PMU && INPUT=y + default y + config ADB_PMU_LED bool "Support for the Power/iBook front LED" depends on PPC_PMAC && ADB_PMU diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile index 49819b1b6f20..712edcb3e0b0 100644 --- a/drivers/macintosh/Makefile +++ b/drivers/macintosh/Makefile @@ -12,7 +12,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 b1859e5340b3..022e2fd4397b 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -1468,12 +1468,14 @@ pmu_handle_data(unsigned char *data, int len) if (pmu_battery_count) query_battery_state(); pmu_pass_intr(data, len); +#ifdef CONFIG_ADB_PMU_EVENT /* len == 6 is probably a bad check. But how do I * know what PMU versions send what events here? */ if (len == 6) { via_pmu_event(PMU_EVT_POWER, !!(data[1]&8)); via_pmu_event(PMU_EVT_LID, data[1]&1); } +#endif break; default: -- 2.32.0