From patchwork Thu Jun 13 20:55:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagannadha Sutradharudu Teki X-Patchwork-Id: 251163 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AAA1E2C007E for ; Fri, 14 Jun 2013 06:58:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A8BFF4A097; Thu, 13 Jun 2013 22:58:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RzlTGUg2oYW6; Thu, 13 Jun 2013 22:58:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 115C84A0C3; Thu, 13 Jun 2013 22:57:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BD0094A0B8 for ; Thu, 13 Jun 2013 22:56:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0FGtA77+MSg1 for ; Thu, 13 Jun 2013 22:56:45 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe002.messaging.microsoft.com [216.32.180.185]) by theia.denx.de (Postfix) with ESMTPS id 910804A0A1 for ; Thu, 13 Jun 2013 22:56:29 +0200 (CEST) Received: from mail216-co1-R.bigfish.com (10.243.78.247) by CO1EHSOBE020.bigfish.com (10.243.66.83) with Microsoft SMTP Server id 14.1.225.23; Thu, 13 Jun 2013 20:56:21 +0000 Received: from mail216-co1 (localhost [127.0.0.1]) by mail216-co1-R.bigfish.com (Postfix) with ESMTP id 37C3F4403CF; Thu, 13 Jun 2013 20:56:21 +0000 (UTC) X-Forefront-Antispam-Report: CIP:149.199.60.83; KIP:(null); UIP:(null); IPV:NLI; H:xsj-gw1; RD:unknown-60-83.xilinx.com; EFVD:NLI X-SpamScore: 1 X-BigFish: VPS1(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bh8275dhz2fh95h668h839hd24hf0ah119dh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h906i1155h192ch) Received-SPF: pass (mail216-co1: domain of xilinx.com designates 149.199.60.83 as permitted sender) client-ip=149.199.60.83; envelope-from=jagannadha.sutradharudu-teki@xilinx.com; helo=xsj-gw1 ; helo=xsj-gw1 ; Received: from mail216-co1 (localhost.localdomain [127.0.0.1]) by mail216-co1 (MessageSwitch) id 1371156979487554_30891; Thu, 13 Jun 2013 20:56:19 +0000 (UTC) Received: from CO1EHSMHS001.bigfish.com (unknown [10.243.78.227]) by mail216-co1.bigfish.com (Postfix) with ESMTP id 6A87148004B; Thu, 13 Jun 2013 20:56:19 +0000 (UTC) Received: from xsj-gw1 (149.199.60.83) by CO1EHSMHS001.bigfish.com (10.243.66.11) with Microsoft SMTP Server id 14.1.225.23; Thu, 13 Jun 2013 20:56:19 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1.xilinx.com) by xsj-gw1 with esmtp (Exim 4.63) (envelope-from ) id 1UnEZ9-0001Fm-5r; Thu, 13 Jun 2013 13:56:19 -0700 From: Jagannadha Sutradharudu Teki To: Date: Fri, 14 Jun 2013 02:25:35 +0530 X-Mailer: git-send-email 1.8.3 In-Reply-To: <1371156936-23067-1-git-send-email-jaganna@xilinx.com> References: <1371156936-23067-1-git-send-email-jaganna@xilinx.com> X-RCIS-Action: ALLOW MIME-Version: 1.0 Message-ID: X-OriginatorOrg: xilinx.com Cc: Hoyler Gernot , "Todd Legler (tlegler)" , Willis Max , Jagannadha Sutradharudu Teki , Syed@theia.denx.de, Hussain , Rajeshwari Shinde , Tom Rini , Daassi Bacem Subject: [U-Boot] [PATCH v4 13/14] sf: Remove spi_flash_cmd_poll_bit() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de There is no other call other than spi_flash_cmd_wait_ready(), hence removed spi_flash_cmd_poll_bit and use the poll status code spi_flash_cmd_wait_ready() itself. Signed-off-by: Jagannadha Sutradharudu Teki Reviewed-by: Simon Glass --- Changes for v4: - none Changes for v3: - none Changes for v2: - none drivers/mtd/spi/spi_flash.c | 11 +++-------- drivers/mtd/spi/spi_flash_internal.h | 4 ---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 88efa92..e5b401f 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -194,13 +194,14 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, return ret; } -int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout, - u8 cmd, u8 poll_bit) +int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) { struct spi_slave *spi = flash->spi; unsigned long timebase; int ret; u8 status; + u8 poll_bit = STATUS_WIP; + u8 cmd = CMD_READ_STATUS; ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN); if (ret) { @@ -231,12 +232,6 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout, return -1; } -int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) -{ - return spi_flash_cmd_poll_bit(flash, timeout, - CMD_READ_STATUS, STATUS_WIP); -} - int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) { u32 erase_size; diff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h index e613ef3..e9b85bf 100644 --- a/drivers/mtd/spi/spi_flash_internal.h +++ b/drivers/mtd/spi/spi_flash_internal.h @@ -107,10 +107,6 @@ int spi_flash_bank_config(struct spi_flash *flash, u8 idcode0); int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd, size_t cmd_len, void *data, size_t data_len); -/* Send a command to the device and wait for some bit to clear itself. */ -int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout, - u8 cmd, u8 poll_bit); - /* * Send the read status command to the device and wait for the wip * (write-in-progress) bit to clear itself.