From patchwork Sun Feb 14 20:48:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 582567 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 4AAD1140321 for ; Mon, 15 Feb 2016 07:53:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 12109A7682; Sun, 14 Feb 2016 21:52:05 +0100 (CET) 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 cEjjz0QXpY-m; Sun, 14 Feb 2016 21:52:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E971A75C9; Sun, 14 Feb 2016 21:51:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 292E8A7622 for ; Sun, 14 Feb 2016 21:51:32 +0100 (CET) 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 pkkZMPUSNnvi for ; Sun, 14 Feb 2016 21:51:32 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by theia.denx.de (Postfix) with ESMTPS id 04152A7606 for ; Sun, 14 Feb 2016 21:51:12 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id fl4so62591147pad.0 for ; Sun, 14 Feb 2016 12:51:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=11/OhbaHMcALztSM2moU1KlM8dWl5d39uTkomaqueGI=; b=FVNQiHrJbtEydJKmBnkC+N95tEgNNYLBzgul5JV3+4BR9UEi7OU6UFvMaiDZHTB/dN jbprQBnRZjahOPIZ5M2BA9w2T/VFFjeA+OAJUnG+ziNGU7fm45RDo9tzgDAivVVJ7k0y k2anhTtTyKOXX296WPysT+nUNBhIXcxTvKE6C+2WjjH+LYZ0RGXR1AGT42Fd7X4iul9S JJd2l+hMq4cPa+Di9W+JGkkyLcw4xdghhGPYPWmDiwIwLUB5grIURT/czwDgYC5jiXum B4AS9W65vjVPXV3aoO3K6gJ43u+pDJ575AB1uZr1Pgt46jPIZgR/7O80y7wGI0km2Lwk 4SdQ== X-Gm-Message-State: AG10YOQkyrxXr5Uq6XKWEKyOoEOpc2jONJ4VM1MKzf+StoAr51rLeUb+r7pcWa66mAcDYw== X-Received: by 10.66.100.163 with SMTP id ez3mr18781311pab.27.1455483070708; Sun, 14 Feb 2016 12:51:10 -0800 (PST) Received: from localhost.localdomain ([123.236.183.254]) by smtp.gmail.com with ESMTPSA id cq9sm11423890pac.26.2016.02.14.12.51.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Feb 2016 12:51:09 -0800 (PST) From: Jagan Teki To: u-boot@lists.denx.de Date: Mon, 15 Feb 2016 02:18:16 +0530 Message-Id: <1455482955-19053-17-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455482955-19053-1-git-send-email-jteki@openedev.com> References: <1455482955-19053-1-git-send-email-jteki@openedev.com> Cc: Michal Simek , Siva Durga Prasad Paladugu , Jagan Teki Subject: [U-Boot] [PATCH v6 17/76] spi_flash: Use spi_flash_t instead of struct spi_flash X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" spi_flash_t same typedef alias name for spi_flash and mtd_info so which one will use based on the user config definition. Cc: Simon Glass Cc: Bin Meng Cc: Mugunthan V N Cc: Michal Simek Cc: Siva Durga Prasad Paladugu Signed-off-by: Jagan Teki --- cmd/sf.c | 10 +++++----- common/env_sf.c | 2 +- include/spi_flash.h | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/sf.c b/cmd/sf.c index 0fda27c..5dd7177 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -19,7 +19,7 @@ #include #include -static struct spi_flash *flash; +static spi_flash_t *flash; /* * This function computes the length argument for the erase command. @@ -89,7 +89,7 @@ static int do_spi_flash_probe(int argc, char * const argv[]) struct udevice *new, *bus_dev; int ret; #else - struct spi_flash *new; + spi_flash_t *new; #endif if (argc >= 2) { @@ -166,7 +166,7 @@ static int do_spi_flash_probe(int argc, char * const argv[]) * @param skipped Count of skipped data (incremented by this function) * @return NULL if OK, else a string containing the stage which failed */ -static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset, +static const char *spi_flash_update_block(spi_flash_t *flash, u32 offset, size_t len, const char *buf, char *cmp_buf, size_t *skipped) { char *ptr = (char *)buf; @@ -208,7 +208,7 @@ static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset, * @param buf buffer to write from * @return 0 if ok, 1 on error */ -static int spi_flash_update(struct spi_flash *flash, u32 offset, +static int spi_flash_update(spi_flash_t *flash, u32 offset, size_t len, const char *buf) { const char *err_oper = NULL; @@ -436,7 +436,7 @@ static void spi_test_next_stage(struct test_info *test) * @param vbuf Verification buffer * @return 0 if ok, -1 on error */ -static int spi_flash_test(struct spi_flash *flash, uint8_t *buf, ulong len, +static int spi_flash_test(spi_flash_t *flash, uint8_t *buf, ulong len, ulong offset, uint8_t *vbuf) { struct test_info test; diff --git a/common/env_sf.c b/common/env_sf.c index 6d5d847..cf909c0 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -43,7 +43,7 @@ DECLARE_GLOBAL_DATA_PTR; char *env_name_spec = "SPI Flash"; -static struct spi_flash *env_flash; +static spi_flash_t *env_flash; #if defined(CONFIG_ENV_OFFSET_REDUND) int saveenv(void) diff --git a/include/spi_flash.h b/include/spi_flash.h index 9c8e52c..29c07f5 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -173,6 +173,8 @@ void spi_flash_free(spi_flash_t *flash); #else +typedef struct spi_flash spi_flash_t; + static inline int spi_flash_protect(struct spi_flash *flash, u32 ofs, u32 len, bool prot) {