From patchwork Sun Aug 16 08:43:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 507865 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 928FB14029C for ; Mon, 17 Aug 2015 17:26:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA1474BE04; Mon, 17 Aug 2015 09:18:21 +0200 (CEST) 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 ki7O_X6QzpXw; Mon, 17 Aug 2015 09:18:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ECFC24BE05; Mon, 17 Aug 2015 09:16:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5E7E54B616 for ; Sun, 16 Aug 2015 10:44:18 +0200 (CEST) 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 HRb8F5Ot_GNQ for ; Sun, 16 Aug 2015 10:44:18 +0200 (CEST) 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-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by theia.denx.de (Postfix) with ESMTPS id E61E34B615 for ; Sun, 16 Aug 2015 10:44:14 +0200 (CEST) Received: by pdrh1 with SMTP id h1so45406210pdr.0 for ; Sun, 16 Aug 2015 01:44:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QnxT8WLplTWV3q4slI4GklekQye8YK12RMtMBECZKCQ=; b=Spp+OfxndPJstIGNNTC2KQEaaVV6peOE/QiKzrPu32yHodiNAY7halBTgi1Wtn4Odq S3Bhi/1SxnDJkcLIjKByXdY/vn5E43Vz8gapPVEhTcTF2wbBorIrobxzMX1quMH1vAgF L8lzVlK1bP9ECwmVdjvDkEwPUu90Amvflmo/qZBuMI1XOex0Tjax5bJi5UcbFgYq0nQO VHLQITtap+f3Wx4rR/mfGKfZEziu4n9CbYC/UELqICG+fzCZLxDea0dVT9OnkNEvMhXD PR3ZlVCyD1vsYO9eUzyUZxsMLP3EbazBhUu3yRuTGqsNoQ05crIdqd55hOqev0l8xqmM ZwxQ== X-Received: by 10.70.91.166 with SMTP id cf6mr106773257pdb.44.1439714652278; Sun, 16 Aug 2015 01:44:12 -0700 (PDT) Received: from Jubuntu.reliancebroadband.co.in ([123.236.183.10]) by smtp.gmail.com with ESMTPSA id pa1sm10844446pdb.73.2015.08.16.01.44.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Aug 2015 01:44:11 -0700 (PDT) From: Jagan Teki To: u-boot@lists.denx.de Date: Sun, 16 Aug 2015 14:13:45 +0530 Message-Id: <1439714629-6003-3-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439714629-6003-1-git-send-email-jteki@openedev.com> References: <1439714629-6003-1-git-send-email-jteki@openedev.com> Cc: Jagan Teki , Michal Simek , Siva Durga Prasad Paladugu Subject: [U-Boot] [PATCH 2/6] sf: Return proper bank_sel, if flash->bank_curr == bank_sel 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" If computed bank_sel is same as flash->bank_curr which is computed at probe time, then return the bank_sel instead of zero. Signed-off-by: Jagan Teki Cc: Michal Simek Cc: Siva Durga Prasad Paladugu --- drivers/mtd/spi/sf_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c index 38592f5..5cb4ef6 100644 --- a/drivers/mtd/spi/sf_ops.c +++ b/drivers/mtd/spi/sf_ops.c @@ -101,7 +101,7 @@ static int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel) if (flash->bank_curr == bank_sel) { debug("SF: not require to enable bank%d\n", bank_sel); - return 0; + return bank_sel; } cmd = flash->bank_write_cmd;