Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4846943yba; Wed, 10 Apr 2019 06:15:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqpqnp6nzjrP39Tu79Ho3Ck9DUSvVIpc3f38RI77OnFagim0M+U5rXpw2wqVjGC8U2apL5 X-Received: by 2002:a62:ee0a:: with SMTP id e10mr43327147pfi.6.1554902116581; Wed, 10 Apr 2019 06:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554902116; cv=none; d=google.com; s=arc-20160816; b=n/syGcGY4E2NYb+sjSqhb0VHBIikaTz+Y1oQExtg3I8gK1zQGgtcxrL7CO8YcJ6nHV hqL1wQgSCuwSq79Rn/ziHnZ9YDmVWxhNAsR6MZ7w9i2tWQItR3e5zxf2zHTBn7W/pkGb aYlAXc/VIS7L2eOXJRZfG41yrIdoBdvysclYxkectdlftggh5XT5uEOWhU2OrXUvcu3Y P82VLjSC42PCpVhly+ZFE4vO7OwS+smCZN2fGTihFLSEFjeLZkdo0WLWR8UwcFr/ltWm +BIwsABTZxjT0oMTYktfkRb0/XuYMC3iY8gzhwTrgdZZrAH6R696YIFMGX/TM5BARF0t 5RPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=uQ4/FUaZf2kI76BPrWyC9/bb60jNljFR9oeE8Me7JPM=; b=hUYEk7NNvWdKlCptTLOTa71EmV11NclPLziBqz4lkAZCk4hjmzBveNOhH0V5JJ41Fr /1PLTK8yBLFNd+nEiFL0hp3bg2TtOYCx6hW2bETaibcqkU+KadXrxsK5jT1eiaMpPWsN IR4SOcE39l20abH8ccBtPMJznJWitjY6nfeb021VHhfvbuMnt2fb5ZNJwdEK+GD9XSsl 0uiEsQcNjbqIwxt2kxrRFmtgb5tg1Xcy3vvRNg+Y2tBpTE57WjKqsSZzFYbNGwD04MgS nxSRVI4VTkiaZ88OO2ZJA9CKh/UXf5u4o205kIOJx0L6CTKBRXFITmipFIE/IYbjbF7A 569Q== 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 x6si27392149pgb.18.2019.04.10.06.15.00; Wed, 10 Apr 2019 06:15:16 -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; 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 S1731785AbfDJMOP (ORCPT + 99 others); Wed, 10 Apr 2019 08:14:15 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55534 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727497AbfDJMOO (ORCPT ); Wed, 10 Apr 2019 08:14:14 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id BEB87A1591887A1C9435; Wed, 10 Apr 2019 20:14:11 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Wed, 10 Apr 2019 20:14:00 +0800 From: Yue Haibing To: , CC: , , , YueHaibing Subject: [PATCH v2] spi: spi-mem: Fix build error without CONFIG_SPI_MEM Date: Wed, 10 Apr 2019 20:13:41 +0800 Message-ID: <20190410121341.17560-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20190408143949.10688-1-yuehaibing@huawei.com> References: <20190408143949.10688-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YueHaibing When building with CONFIG_SPI_MEM is not set gc warns this: drivers/spi/spi-zynq-qspi.o: In function `zynq_qspi_supports_op': spi-zynq-qspi.c:(.text+0x1da): undefined reference to `spi_mem_default_supports_op' Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller") Signed-off-by: YueHaibing --- v2: make stub helper static inline --- include/linux/spi/spi-mem.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index c845cd6..3d57db8 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -295,6 +295,10 @@ int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr, void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, const struct spi_mem_op *op, struct sg_table *sg); + +bool spi_mem_default_supports_op(struct spi_mem *mem, + const struct spi_mem_op *op); + #else static inline int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr, @@ -310,6 +314,14 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, struct sg_table *sg) { } + +static inline bool +spi_mem_default_supports_op(struct spi_mem *mem, + const struct spi_mem_op *op) +{ + return false; +} + #endif /* CONFIG_SPI_MEM */ int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op); @@ -341,9 +353,6 @@ int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv, void spi_mem_driver_unregister(struct spi_mem_driver *drv); -bool spi_mem_default_supports_op(struct spi_mem *mem, - const struct spi_mem_op *op); - #define spi_mem_driver_register(__drv) \ spi_mem_driver_register_with_owner(__drv, THIS_MODULE) -- 2.7.4