Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5230469ybc; Wed, 27 Nov 2019 00:23:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxWoG8N6ZcuUfzxafP3wiPDSRk3+zogA1srjqKm9vyjtND/DgLCdeOfVYMOTJv7pNRx2Mmd X-Received: by 2002:a05:6402:17e7:: with SMTP id t7mr23727118edy.114.1574843027688; Wed, 27 Nov 2019 00:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574843027; cv=none; d=google.com; s=arc-20160816; b=vUY8cdNs0wc5lIvDlK9A7jMDjaEAD6SpOq2AizdKKaUpQSTbVc3OFP3+n3zEck78KY O/EBHywHTidIbpxf7dx2mRMNQXE7JY5JSqC2KUBdpgpjkShn0WkUxPJHJVNMhn2Fe/eF P2AemRLjhR4Ohwp85WDWa75ZLEXJSAHEpcoT5LDBty5vISKy9elSCoz6txS6y+Eyw8Dz Ie7uhbenGNz/AL6RypOQLN7YvNpDgbGnVqZlYCtuSDPSoKX0RAjr0Fs35/KEu6hv2+mZ RjCCorXxruh0CKyq5FQp49ivUj+WeLVh9A3b4W9UsqHV+plSUgywArK4F7Et5qtGzNj4 dwVA== 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; bh=ez1Bflao3c6ym9/KreFsRrJ3PiBM4IlDAckNZ6MoGgw=; b=YQ8RPdt7SMLlmYV0Z2n2xEr/g7ohvL0BnJsstjT9ZRR2keTFhoplBJb7wu191wnF6p Fyd+tZx+PmkZD37PGkbVKDjAsq6doTLzTuFcDmVhgNTuPMdHxpLztt7MOUZk4DUj4la9 6fUSQpkDHdRbO+JX4hc0wQcvi1BtR/rhXFbFy/I83D2tlMDpsdt4DDlv4XWljObqjmaH 4gNu3w0e1a5xpapc5mibNud9tESOB5pnPyYv31bFpru3rnH/iYBpU/GUEXHcvE+TYSVe gK1U78yObcwkHxdaz+fTL09cau2TjKA3M/a6/EOPnbi8jHiN7JR09sytUsJjUKkiH/Fc RtvA== 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 z28si10221772edm.123.2019.11.27.00.23.01; Wed, 27 Nov 2019 00:23:47 -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 S1726267AbfK0IWJ (ORCPT + 99 others); Wed, 27 Nov 2019 03:22:09 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6722 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726125AbfK0IWI (ORCPT ); Wed, 27 Nov 2019 03:22:08 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D27E9A28826B1B02A339; Wed, 27 Nov 2019 16:22:06 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Wed, 27 Nov 2019 16:21:57 +0800 From: YueHaibing To: , , , , , , , CC: , , YueHaibing Subject: [PATCH -next] ASoC: rt5677: Fix build error without CONFIG_SPI Date: Wed, 27 Nov 2019 16:21:45 +0800 Message-ID: <20191127082145.6100-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_SPI is n, SND_SOC_RT5677_SPI also is n, building fails: sound/soc/codecs/rt5677.o: In function `rt5677_irq': rt5677.c:(.text+0x2dbf): undefined reference to `rt5677_spi_hotword_detected' sound/soc/codecs/rt5677.o: In function `rt5677_dsp_work': rt5677.c:(.text+0x3709): undefined reference to `rt5677_spi_write' This adds stub helpers to fix this. Reported-by: Hulk Robot Fixes: 461c623270e4 ("ASoC: rt5677: Load firmware via SPI using delayed work") Signed-off-by: YueHaibing --- sound/soc/codecs/rt5677-spi.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/codecs/rt5677-spi.h b/sound/soc/codecs/rt5677-spi.h index 3af36ec..088b779 100644 --- a/sound/soc/codecs/rt5677-spi.h +++ b/sound/soc/codecs/rt5677-spi.h @@ -9,9 +9,25 @@ #ifndef __RT5677_SPI_H__ #define __RT5677_SPI_H__ +#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI) int rt5677_spi_read(u32 addr, void *rxbuf, size_t len); int rt5677_spi_write(u32 addr, const void *txbuf, size_t len); int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw); void rt5677_spi_hotword_detected(void); +#else +static inline int rt5677_spi_read(u32 addr, void *rxbuf, size_t len) +{ + return -EINVAL; +} +static inline int rt5677_spi_write(u32 addr, const void *txbuf, size_t len) +{ + return -EINVAL; +} +static inline int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw) +{ + return -EINVAL; +} +static inline void rt5677_spi_hotword_detected(void){} +#endif #endif /* __RT5677_SPI_H__ */ -- 2.7.4