From patchwork Sat May 12 06:24:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 10395817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2471E60236 for ; Sat, 12 May 2018 06:25:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04D2528F1E for ; Sat, 12 May 2018 06:25:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8A8728F23; Sat, 12 May 2018 06:25:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36F0528F1E for ; Sat, 12 May 2018 06:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750739AbeELGZM (ORCPT ); Sat, 12 May 2018 02:25:12 -0400 Received: from mail.bootlin.com ([62.4.15.54]:33217 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbeELGZL (ORCPT ); Sat, 12 May 2018 02:25:11 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 866C520750; Sat, 12 May 2018 08:25:09 +0200 (CEST) Received: from localhost.localdomain (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 5BD242055A; Sat, 12 May 2018 08:24:59 +0200 (CEST) From: Boris Brezillon To: Mark Brown , linux-spi@vger.kernel.org Cc: Boris Brezillon Subject: [PATCH] spi: bcm-qspi: Fix build failure caused by spi_flash_read() API removal Date: Sat, 12 May 2018 08:24:54 +0200 Message-Id: <20180512062454.27407-1-boris.brezillon@bootlin.com> X-Mailer: git-send-email 2.14.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch http://patchwork.ozlabs.org/patch/905205/ has been partially applied, and changes to the bcm-qspi driver have been lost somehow (probably due to a conflict when applying the patch). Remove the ->spi_flash_read() bits from this driver to fix the build error. Fixes: c1f5ba70decf ("spi: Get rid of the spi_flash_read() API") Signed-off-by: Boris Brezillon --- Hi Mark, Ideally this patch should be squashed in commit c1f5ba70decf to avoid breaking bisectability, but I don't know what's your policy regarding force push, so I'll let you decide what is more appropriate here. Thanks, Boris --- drivers/spi/spi-bcm-qspi.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 9f94268a68b5..57ceec6c6301 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -944,9 +944,10 @@ static int bcm_qspi_mspi_exec_mem_op(struct spi_device *spi, return ret; } -static int bcm_qspi_exec_mem_op(struct spi_device *spi, +static int bcm_qspi_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op) { + struct spi_device *spi = mem->spi; struct bcm_qspi *qspi = spi_master_get_devdata(spi->master); int ret = 0; bool mspi_read = false; @@ -991,34 +992,6 @@ static int bcm_qspi_exec_mem_op(struct spi_device *spi, return ret; } -static int bcm_qspi_exec_mem_op_wrapper(struct spi_mem *mem, - const struct spi_mem_op *op) -{ - return bcm_qspi_exec_mem_op(mem->spi, op); -} - -static int bcm_qspi_flash_read_wrapper(struct spi_device *spi, - struct spi_flash_read_message *msg) -{ - int ret; - struct spi_mem_op op = SPI_MEM_OP(SPI_MEM_OP_CMD(msg->read_opcode, 1), - SPI_MEM_OP_ADDR(msg->addr_width, - msg->from, - msg->addr_nbits), - SPI_MEM_OP_DUMMY(msg->dummy_bytes, - msg->addr_nbits), - SPI_MEM_OP_DATA_IN(msg->len, - msg->buf, - msg->data_nbits)); - - msg->retlen = 0; - ret = bcm_qspi_exec_mem_op(spi, &op); - if (!ret) - msg->retlen = msg->len; - - return ret; -} - static void bcm_qspi_cleanup(struct spi_device *spi) { struct bcm_qspi_parms *xp = spi_get_ctldata(spi); @@ -1214,7 +1187,7 @@ static void bcm_qspi_hw_uninit(struct bcm_qspi *qspi) } static const struct spi_controller_mem_ops bcm_qspi_mem_ops = { - .exec_op = bcm_qspi_exec_mem_op_wrapper, + .exec_op = bcm_qspi_exec_mem_op, }; static const struct of_device_id bcm_qspi_of_match[] = { @@ -1259,7 +1232,6 @@ int bcm_qspi_probe(struct platform_device *pdev, master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_RX_DUAL | SPI_RX_QUAD; master->setup = bcm_qspi_setup; master->transfer_one = bcm_qspi_transfer_one; - master->spi_flash_read = bcm_qspi_flash_read_wrapper; master->mem_ops = &bcm_qspi_mem_ops; master->cleanup = bcm_qspi_cleanup; master->dev.of_node = dev->of_node;