From patchwork Mon Mar 4 20:04:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159592 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4157869jad; Mon, 4 Mar 2019 12:04:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy4uOUeoc/G5WJL63KX2Z7ZCkhn6Hi/3QZkFXA27BGPiijGsGFdTv1jUnB1w2Y3VQ6lOD6J X-Received: by 2002:a63:6605:: with SMTP id a5mr20151270pgc.372.1551729871971; Mon, 04 Mar 2019 12:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551729871; cv=none; d=google.com; s=arc-20160816; b=ZMdj7dN6nW+7fdKWwjcXOh+jWswa7dq1HKBTrk0EibC4OK349eKz4drmxp1giKPhb8 N73HWo9uAwH2TG0cDiE7SSEgk2FLmZXgKnxZrgeGWWpoK1YtqvniuwZSbi5Z3EAgsiJG DQu+MQIFB8y6bYxdcapHwmJE4643rD8XXIrkttez3WedVrrs+5hs7+CeO4nteYk0/zIj 5thPNxV/bgLJ6siSrmW4jc96vKkCzDD2AqNe7MCFweLXKZo2Zz5JIbCvw6RlNZh934tl HeVrQAuVTm61juztSVNH70BzrGNiCuIAXpDnLwiGo+zwVjN9+hM7epu0EW3yclVutYXh BuFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3ENNmVAIPkFOQj5H8lyMePwToXjJDsJ9Ank96fkT7NY=; b=CprAhN7Eg+WsGeOeHTgVRrWJ9cUsEaAM3G6aTDaO/9oxaKNegNgeDNV1hnhOA2aP3O OsBy4QtLtbCkojdwrBpccFQBR22B+XebUsuY9pwWbfMGrvMvU550fGmWyeFQ9qOV/Y00 ntBIm4wlvpmC7/KFJuyIF/TDqA4cY2DK6XjYsNjnXaIw04h/9OP5hHnG3DO1cEsLFlKu 4Ssy1uEYp8oCt7yQ7POAZQVWwZvTiY3R090aAQ7mtbPcihWUPIyiWKfr9rFFDtm7RmnX 8/st5SH/XLi7FveshEzJnxus2hFmNvL+/pup5yVdpt27twb29xXTgbkzW+ISkaeuap3Y 7uyQ== 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 y142si6446769pfb.149.2019.03.04.12.04.31; Mon, 04 Mar 2019 12:04:31 -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 S1726410AbfCDUE3 (ORCPT + 31 others); Mon, 4 Mar 2019 15:04:29 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:52925 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfCDUE3 (ORCPT ); Mon, 4 Mar 2019 15:04:29 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MqJuP-1hN5bi2Y55-00nN5z; Mon, 04 Mar 2019 21:04:13 +0100 From: Arnd Bergmann To: Oded Gabbay , Arnd Bergmann , Greg Kroah-Hartman Cc: Mike Rapoport , linux-kernel@vger.kernel.org Subject: [PATCH] misc: habanalabs: avoid HWMON dependency Date: Mon, 4 Mar 2019 21:04:02 +0100 Message-Id: <20190304200412.1269035-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:XyKcooFXQhX2uuTXTRZ2R3hAkAHkzbVMcnRmfEhsadCcZm60/V/ KDd7EfSy4udHv4jJe9jazHsQ1DQdQ9PoPcUw0/TRZG7RDRae8tTXVzy2Qx11jBg29NdC4q2 ROP1qp8TMvcLjBniy2Vlm/zlXCIr/kIfu5iz44f2EVO7+r+WEmBm/nKQkZyAOJbOMWjYc11 C3+gIfefptZf9cLrGSHVA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:gTsI42fWA0M=:O+tbH+o0S3oDVqo1HqDwEY tIXhWdewERlcKU5ppFzk38XgA1p2rFX6ypYlFg1x1s8DFJTyQkWRCmolh2igwsOnSK/ErUBXj tIccNnq3CjYJ0/Z0LsVA2k1m+fLw1jYGE3yIfeo6orOGcbSXIMivWNjGzjNsmgng6d1WxC/ax qgdkdEXJEpkq80laZpadyIy8CZOxasm8uK7wnXgKy9ddSfiJuQWcEOD3pkGEy0viT1eUs9M4A GfzNmfBLpuhziAaap5e58xUj2+CvgxnI46kH8ajoomgGj/9Miy2+kKPUJDgckvGVuznA8aGK7 Ne0VtTFrpXB38G5829XgPtvL3JaPoBTGWuCBzFEUPphkxv9Zv9TZJU72T7Bmkm8q8OEjnvrn6 YLmGmPNexvZX3DdDbUxEgBMxa2m/X4XNTlp1nXDDYFu1JI/zypQE92iS4LtgOJm86V7wVOrdL AM1QqCxs8GwHCqSvhothu924LRlYlwp/VP9A9UoPLaIA46kHlM0n2EfUX3XK0lco4zoyLhcLw YHUZHR1dhiUvPwHt6RkVqjvxgPuHus9uSvVxKZ5kYzPwIshpuc5t1qbyHZF+C4bdQDDzxyAqf 2VyguEu6nvTvXdI4yaqEllkv/XWCNJR6oZax7dUS0MON8xFFfGakTlYN3fXzYrjpsrhfE8h51 2iSnHfbxodg15OMqfjI+5MJTZayPvJlQSRtNAktfsWb5xn63UMArK5gD/aeEQPAbbO2X5acUO WzhJhtBZtYv45qcYxP92tze3ghrV4Kz0lLcThw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_HWMON is disabled, we currently get a link error for this driver: ERROR: "hwmon_device_unregister" [drivers/misc/habanalabs/habanalabs.ko] undefined! ERROR: "hwmon_device_register_with_info" [drivers/misc/habanalabs/habanalabs.ko] undefined! As the hardware monitoring is not a required part of the functionality, make it possible to compile without HWMON by ignoring all that functionality depending on the configuration. Signed-off-by: Arnd Bergmann --- drivers/misc/habanalabs/hwmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.0 diff --git a/drivers/misc/habanalabs/hwmon.c b/drivers/misc/habanalabs/hwmon.c index 77facd25c4a2..933746639831 100644 --- a/drivers/misc/habanalabs/hwmon.c +++ b/drivers/misc/habanalabs/hwmon.c @@ -423,7 +423,7 @@ int hl_hwmon_init(struct hl_device *hdev) struct device *dev = hdev->pdev ? &hdev->pdev->dev : hdev->dev; int rc; - if ((hdev->hwmon_initialized) || !(hdev->fw_loading)) + if (!IS_ENABLED(CONFIG_HWMON) || (hdev->hwmon_initialized) || !(hdev->fw_loading)) return 0; if (hdev->hl_chip_info->info) { @@ -451,7 +451,7 @@ int hl_hwmon_init(struct hl_device *hdev) void hl_hwmon_fini(struct hl_device *hdev) { - if (!hdev->hwmon_initialized) + if (!IS_ENABLED(CONFIG_HWMON) || !hdev->hwmon_initialized) return; hwmon_device_unregister(hdev->hwmon_dev);