Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2951093yba; Mon, 8 Apr 2019 08:05:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqws4R3JD5s5sFG7j39OGGaLoPfeueOwflkAGCrYXnq5Dj7Lf241ZzfQyu988F1L3ceB30ew X-Received: by 2002:a17:902:20eb:: with SMTP id v40mr30004490plg.20.1554735916716; Mon, 08 Apr 2019 08:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554735916; cv=none; d=google.com; s=arc-20160816; b=09RQRDUBQZN5UpcZs0Rei8IKNRYIXLkG0vAiB0Q3jMqjkwBR5uhU6Xt0itw2vJjt4y 0Y8kpGPvWmqKb6ZjYP4HP62DyvoeWYsa51u/TwNeC6PAUeBebiXaYev6g0u2uaxm6AE0 yknbE8H29UmSmLIT+Tn74oBfCuQbya5qfuC/nlnHm584/wkzaa572aOwA/wJ0A+nShoT AXWcDzCIDoESB8xIR0QdXgvZOXokAX5/hEzXDkKGhvl3lPqvPkHKo2TqOQDocxRaFBJe 3OQ2sYYPwCkDW8c7XYBuxnKEUy46At5jg5OhOWw9keKJgh37gqWGgu4UpZvq91gt1HKf BZww== 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=hC1ebe4ugZXdyR/v2QcuqRysDkAzakPlFo4YvUjQ4BI=; b=U7+eT8NSxGmqpWnZdPRJ0uBZCztGZr1zWnNrsQG9p+6qhZzUP+6VBcyrXdqV4FL7kK HnGTfr9jxkWviU1lpdxUImQiYxR2E9w24aRT6l5tQarX6nb5inCGy1a5FHZVQQHcVTN8 v29bxqlilOcccrDwgTQtUPRnBT2jqkH9dYNYJXj/KnwRREAlbzlODiVYDxxgFcNqMgLl JkPhER8jUTnNNgs0zUpQZAVz3V+AiYSGQfWpvBGfLQ0tw+7YI0ddho9bVbi7mPagApwV CP3bIiilM9/ewi6+LS3vHE3Q0ZcqdGzb4Qm5RUqBsWqtUDOQpb1EUBlxQQ5h32GUGFsb kmKw== 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 k126si26346882pgk.109.2019.04.08.08.04.59; Mon, 08 Apr 2019 08:05: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 S1727281AbfDHOks (ORCPT + 99 others); Mon, 8 Apr 2019 10:40:48 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5699 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727276AbfDHOks (ORCPT ); Mon, 8 Apr 2019 10:40:48 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4ED3D8A40540FCBD7339; Mon, 8 Apr 2019 22:40:43 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Mon, 8 Apr 2019 22:40:33 +0800 From: Yue Haibing To: , CC: , , YueHaibing Subject: [PATCH] spi: spi-mem: Fix build error without CONFIG_SPI_MEM Date: Mon, 8 Apr 2019 22:39:49 +0800 Message-ID: <20190408143949.10688-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.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 --- include/linux/spi/spi-mem.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index c845cd6..1941b84 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,13 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, struct sg_table *sg) { } + +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 +352,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