Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3098500imb; Tue, 5 Mar 2019 00:28:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzsppAC6EiCagk4UszP7vyK6vZ9E+88zQdk6N6H2CXSmdallCNumjByX5NuReooeOiF76Xw X-Received: by 2002:a63:7e0e:: with SMTP id z14mr389636pgc.436.1551774490236; Tue, 05 Mar 2019 00:28:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551774490; cv=none; d=google.com; s=arc-20160816; b=rQCR7xj9H11F2h5YaNOJ7B0GEfcVYy6m3HQohExEe8CQ2Se+YcymsZvrF7XAGz+289 P0zJZYHXyBBTXdijIHweyQiSnGCLaPTzlQ8cpxVBHb0o/mbAOpJ8WXEePMaKhW/Ts8aw 4Bp2HKnoAyDYnVBTjduaUT7bN/yxZISQP1olDGAKlF7akyVZOHCBrWhFAosrEOGIWLtj 4PQUiHrg7iJYt8oTurYj559Xuuxh0AsjautPK562TJIUbOcN8OmeHG/e+MtiBuoFpsLe GNb+sALMVVli65hzWOY3d38EAnXlaPGsKjF59uvR2jqtaF2dTHjI86eYGIIL05LAnBy/ OA3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=LWO4T5xEogVMCs06EOCx8kJZPJBaHObz/kRqw0tOs0c=; b=fG2Rqd1OjbBBLzUIW61ycFJtRjZaE3R6v4qnaNBK3x5NcB2DD3ZMIlRvOovQHzKnkx g8b0t8EYaDL0Q8oR/2lDdiofW50tqau1bm6nxWP2fYBKG3qVziNiba3rkLxnQ0I3jJCe NdZAOEg1V4pHMoe+4jvqLWeO5k1WTqS9BoSKK4fPtNjBcR+SwFnSMjbLP+gREHgTnaiK V1ucsmIbwJ9LrVRI2btYooyllmdOEobwzqRhimBRy4Rzzkr1xmxySmJ2clkeNfauSK+5 4cgrH/v/7f19E8JbUgWWk0XfLB7E4yS3H8mcvIteg/JHTrVv8Cr42iXXQdVGeG0Rz/B7 4eig== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h124si7282041pgc.25.2019.03.05.00.27.54; Tue, 05 Mar 2019 00:28:10 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbfCEI0v (ORCPT + 99 others); Tue, 5 Mar 2019 03:26:51 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:38584 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfCEI0v (ORCPT ); Tue, 5 Mar 2019 03:26:51 -0500 Received: by mail-qt1-f193.google.com with SMTP id s1so8145973qte.5 for ; Tue, 05 Mar 2019 00:26:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LWO4T5xEogVMCs06EOCx8kJZPJBaHObz/kRqw0tOs0c=; b=JLwU4U6g3PPufWZJTuXYGzK9D13ldZ8LA7HJIZzwc/3IDDTDo4hFJRqUupu6GFqmCk +depQ7EsmYb3Rv3owEquiC6wZOgMcmZ1uAszTA03YtToSTDYtORPcxRIPK+08OXfSHKB nuUYU2oWPhMT6bexejfyWklk6KHlIvXafZXHYAdhevePiynkc+HGdoUvTDP/E9PFWeu+ FuJuUXhn72uEMitBPpP97ETGlavbYUvkphhYnvKW+apeochgRhSAM1/S9qYAsMjXa4xC 77ZSC8jJMIixv739DWw/TJN3XDqUpsNVo50Bb9cfBLFYx26l61gMqGV7kLPvz1S3yFVf fHbg== X-Gm-Message-State: APjAAAXKVh3GYUQ2XkCPCYaHrp/21jN7x9TKQ2IRhRTSMZNJJssAiQJq KS0NaCIn/mjAF14Y0DBMhKHpcBW5IfVAcow4rP0= X-Received: by 2002:a0c:81ee:: with SMTP id 43mr1133112qve.180.1551774410231; Tue, 05 Mar 2019 00:26:50 -0800 (PST) MIME-Version: 1.0 References: <20190304200719.1382717-1-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Tue, 5 Mar 2019 09:26:33 +0100 Message-ID: Subject: Re: [PATCH] platform/chrome: fix wilco-ec dependencies To: Nick Crews Cc: Benson Leung , Enric Balletbo i Serra , Duncan Laurie , Wei Yongjun , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 1:53 AM Nick Crews wrote: > > On Mon, Mar 4, 2019 at 1:06 PM Arnd Bergmann wrote: > > > > When CROS_EC_LPC is set to =m, we get a link failure for a > > builtin wilco-ec module: > > > > drivers/platform/chrome/wilco_ec/core.o: In function `wilco_ec_remove': > > core.c:(.text+0x26): undefined reference to `cros_ec_lpc_mec_destroy' > > drivers/platform/chrome/wilco_ec/core.o: In function `wilco_ec_probe': > > core.c:(.text+0x18c): undefined reference to `cros_ec_lpc_mec_init' > > core.c:(.text+0x224): undefined reference to `cros_ec_lpc_mec_destroy' > > drivers/platform/chrome/wilco_ec/mailbox.o: In function `wilco_ec_mailbox': > > mailbox.c:(.text+0x104): undefined reference to `cros_ec_lpc_io_bytes_mec' > > > > The problem with the existing CROS_EC_LPC_MEC dependency is that this > > is only for a 'bool' symbol, so the information about the exported > > functions being in a module is lost on the way, and we actually have > > to depend on both CROS_EC_LPC and CROS_EC_LPC_MEC. > > Thanks for the catch Arnd. This looks like a workable solution, although it > brings up a different question to me: Is it weird for a bool option > (such as CROS_EC_LPC_MEC) > to depend upon a tristate option (such as CROS_EC_LPC)? No, not weird at all. > It seems like > CROS_EC_LPC_MEC > should be tristate as well. Would changing this be a better solution? No, that would actually break the code in a different way, since you have: drivers/platform/chrome/Makefile:cros_ec_lpcs-$(CONFIG_CROS_EC_LPC_MEC) += cros_ec_lpc_mec.o drivers/platform/chrome/cros_ec_lpc_reg.c:#ifdef CONFIG_CROS_EC_LPC_MEC drivers/platform/chrome/cros_ec_lpc_reg.c:#else /* CONFIG_CROS_EC_LPC_MEC */ drivers/platform/chrome/cros_ec_lpc_reg.c:#endif /* CONFIG_CROS_EC_LPC_MEC */ With CONFIG_CROS_EC_LPC_MEC=m, it would not get used (CONFIG_CROS_EC_LPC_MEC ends up not defined in C code), and it makes no sense to include a .o file in a loadable module based on a tristate option. Arnd