Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1998023yba; Mon, 15 Apr 2019 02:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWrapU8j2i+0QxSkiu/isFKz/q5dEEkp5Ro2igM4hjFh+5yCjEnudgIqymjHBTlQO1UBig X-Received: by 2002:a63:720e:: with SMTP id n14mr68324739pgc.93.1555321802125; Mon, 15 Apr 2019 02:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555321802; cv=none; d=google.com; s=arc-20160816; b=mX7XQBZuMoL4/u849NDX4m+23ZWBklJKi0KQekl6Eph+WMWC2ifAeAvYQPmRa3P+xI D97MTCFMAYtAGHy5LvuYFQcBDK/7llK0tCwHI1G1d92Ba+XhN2GAlPi+m3R9DhGD7j8h l4AMXT06mqP1sG5w9owkBKAqW1Fy5NSqxMSPorWKvSD8+OLMGKpU4LeE3lxNWi8e60eV SN4DSL4N84GNNG5zmBJO/0sb0PEVPnPGdN/NcHMwrckpHamVP6DSps+Py05cq7FVStSz KPgj87rjQwym1f2bEqu/QeokGct3Ca+N6wu9s834vOVrXJUVxGCY2bK/STQ0dE8g9MHX wHFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=jMielUvtFlnnNMz3h26ZklBL+HQCFxVpPNAWKuTSjPk=; b=viBz40iFsADcVEATG58p6hOUeqWWNwqN95Oo27n3k5G4WjCef4gMB0itKSMovDFNFl PVOa26gPf9ulmwLFOClsDkLhOlFJxL/bSZYoOtCnuPFn1uykEbHWceEj/IbqdadPP05k mlN3cTNioOaQ4eOXYamChMVGnYDbm9w4fylTy6E2GGn9ldq622eOOsNKTZqailJWTfNl 6fN6JBPz1UZuSiydggqjD6PiIkrqYzZs53+EW6+FU8GN7hRXhCjnmaZ9tTuH+IarrIRD VzWdTcjXxwpMvsr1zlmnuVdSDzWZtUfPqzMnjWk7QCLIMFbabZ70mHq1FWSZtMVM4InE 9snQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=O6oNtu+1; 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 v4si44719824pgj.138.2019.04.15.02.49.45; Mon, 15 Apr 2019 02:50:02 -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=@st.com header.s=STMicroelectronics header.b=O6oNtu+1; 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 S1727179AbfDOJsu (ORCPT + 99 others); Mon, 15 Apr 2019 05:48:50 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:22228 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725798AbfDOJst (ORCPT ); Mon, 15 Apr 2019 05:48:49 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3F9k3Qi011233; Mon, 15 Apr 2019 11:47:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=jMielUvtFlnnNMz3h26ZklBL+HQCFxVpPNAWKuTSjPk=; b=O6oNtu+1T8UuAE4/oGkpCwo6yDjkDoJWx7CI4/fmZpyehbTkgrUBt7UsO7kXyAM16I77 hkApZqeTZEZ11EyR7cAMSAU8SpukR6hBP1FRzrLx1dwzqpNTNEpB/r+VsYsoZI6P+B9L NFCSJi387bzYPWjo09OeqYztvcmhJSRknk+NVz4IbL/wRy1mzxYnMnI9H6pQq+THZbzr XJCDILsMH0aC71KQV8Sh4OkX9z+RXXSE1DHJabJncE6CWlDSE6buqMAl/yQ7jrH9mflt Ca1HfHY3kWiV4vFxZNNsOo75lJri6Jxdxl7Iezw23mJxy58ITI5xdYCZ+pZTg94o2KFK ug== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2ru4w823v9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 15 Apr 2019 11:47:51 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E5B9131; Mon, 15 Apr 2019 09:47:48 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 54E1613E4; Mon, 15 Apr 2019 09:47:48 +0000 (GMT) Received: from localhost (10.75.127.45) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 15 Apr 2019 11:47:47 +0200 From: Fabrice Gasnier To: , CC: , , , , , , , , , , , , , , Subject: [PATCH] iio: trigger: stm32-timer: fix build issue when disabled Date: Mon, 15 Apr 2019 11:47:22 +0200 Message-ID: <1555321642-482-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG8NODE2.st.com (10.75.127.23) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-15_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes a build issue when CONFIG_IIO_STM32_TIMER_TRIGGER isn't set but used in stm32-dfsdm-adc driver (e.g. CONFIG_STM32_DFSDM_ADC is set): ERROR: "is_stm32_timer_trigger" [drivers/iio/adc/stm32-dfsdm-adc.ko] undefined! There are two possible options to fix this issue: - select IIO_STM32_TIMER_TRIGGER along with CONFIG_STM32_DFSDM_ADC. This is what's being done currently for CONFIG_STM32_ADC. - stub "is_stm32_timer_trigger" function Choice is made to stub this function as suggested in [1]. This is also inspired by similar "is_stm32_lptim_trigger" function (see [2]) in include/linux/iio/timer/stm32-lptim-trigger.h [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1977377.html [2] https://lkml.org/lkml/2017/9/10/124 Fixes: 11646e81d775 ("iio: adc: stm32-dfsdm: add support for buffer modes") Reported-by: Randy Dunlap Fix-suggested-by: Jonathan Cameron Signed-off-by: Fabrice Gasnier --- include/linux/iio/timer/stm32-timer-trigger.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/iio/timer/stm32-timer-trigger.h b/include/linux/iio/timer/stm32-timer-trigger.h index d68add8..cbb7c7a 100644 --- a/include/linux/iio/timer/stm32-timer-trigger.h +++ b/include/linux/iio/timer/stm32-timer-trigger.h @@ -73,6 +73,15 @@ #define TIM17_OC1 "tim17_oc1" +#if IS_REACHABLE(CONFIG_IIO_STM32_TIMER_TRIGGER) bool is_stm32_timer_trigger(struct iio_trigger *trig); - +#else +static inline bool is_stm32_timer_trigger(struct iio_trigger *trig) +{ +#if IS_ENABLED(CONFIG_IIO_STM32_TIMER_TRIGGER) + pr_warn_once("stm32-timer-trigger not linked in\n"); +#endif + return false; +} +#endif #endif -- 2.7.4