Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4466867yba; Tue, 9 Apr 2019 20:36:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkT8KgJS7ycSUMB1j0Au3ywqed5npm8jLsGvFiTmupI21AQfk2yJGbIU0KJ7PyzJcrYVKM X-Received: by 2002:a17:902:9a03:: with SMTP id v3mr16849884plp.27.1554867413615; Tue, 09 Apr 2019 20:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554867413; cv=none; d=google.com; s=arc-20160816; b=SYCa4+SMWgFHX/mhsW+jPreVfoWtPSdOGKsBCbLU2Fe3rs6t0bMPUL1aXDyDEO4CpF n5DZWUvE9ibfzP18M4MsFuHFkIpfPfoXgFOVcIPb3eyZt+l5++OXeqFKV/T89BjctR5G Lpe1Kh8KhhuMuScDq+Yrs7SrJmPbOBJtW2AJ/cbSX+HhfHGJZ8X6xHq9L+j0mjMmjzdk J3nQ78y/jIru9/Gz28D1AUUiUOAhvUJPT1Ba4KiWctHog1/NyCZBdJm6n8vCgTQSyLCf kRxErw9V2VVa9ZqClsjuDQPoTGPoBAlRibxi8uohaDDDj7objt23UoJ7KuUkOlqW0j4z wB+Q== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=+hZ1FCxAtCo/UA1fKuNNOuCDu57zr7CB/egP2lllnck=; b=P9AfzJ0IbBDV6Ow9nbazsvpB+hJuft5oHobNeIddaV7cYhOTzqgZpv892NYh/rt9DI IpVKi2kbSxr9Imq2EnXcCetEZH5kAX+zBdNTgYPu9K+IKnvtUzLKpj80FeMwUQWdtqT5 8GUaRhIpXrZSWtDWr7elB/Ynf6JkePaE7rxPnBy8ZspOWAxchimpYk2X5t38SozjtOXx ircnUrp2lfBFh/E6HP37Ygy79p9f4tPo8Z8dvAdqFKMbV+aQyltyFgEVO5OIypjZ97xo g5pkv1KcvFHnBDB405kWJR0tTdCO8u4eTgZtfMIZ8pWi9otv7DBQy97QIzDJppXuQxw6 JdIA== 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 o19si29631499pgv.355.2019.04.09.20.36.37; Tue, 09 Apr 2019 20:36:53 -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 S1727040AbfDJDdb (ORCPT + 99 others); Tue, 9 Apr 2019 23:33:31 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6140 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726670AbfDJDdb (ORCPT ); Tue, 9 Apr 2019 23:33:31 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 07A99D2133A587EEC025; Wed, 10 Apr 2019 11:33:29 +0800 (CST) Received: from [127.0.0.1] (10.177.31.96) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.408.0; Wed, 10 Apr 2019 11:33:24 +0800 Subject: Re: [PATCH] spi: spi-mem: Fix build error without CONFIG_SPI_MEM To: Vignesh Raghavendra , , References: <20190408143949.10688-1-yuehaibing@huawei.com> <4c9cb550-e0b6-8f66-979d-ab8237e28166@ti.com> CC: , From: YueHaibing Message-ID: Date: Wed, 10 Apr 2019 11:33:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <4c9cb550-e0b6-8f66-979d-ab8237e28166@ti.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 On 2019/4/10 0:30, Vignesh Raghavendra wrote: > On 08/04/19 8:09 PM, Yue Haibing wrote: >> 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) > > This needs to be declared static inline to avoid multiple definitions. > Right? Indeed, thanks! > >> +{ >> + 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) >> >> >