From patchwork Thu May 14 12:11:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1202 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 349DD3F077 for ; Thu, 14 May 2020 14:12:04 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id q5sf2483018pff.11 for ; Thu, 14 May 2020 05:12:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589458323; cv=pass; d=google.com; s=arc-20160816; b=wuX6D2+3hJTr/bz8QzdzwuZEOepuvoGXwxfjFtZVs11T9aQZ53i+AkB+WKlThMb3F4 JgQx9kOWG+pD/7Lzk5qT+qV3hA7kvzjlrQldWLRkxJvzxuW4enM/kHljEscYgmkYSdNX 3IrMuAFmVOlgt4oYoKDWmVcYSidjMzMoOiRtoacwga4TBs4ML/S6yqhJv9cd3XpBHQDW GN9v/qnthclPbhzwouYQuKrUqPG+xOpM21yWrTH8gvHFb2+hrc4FgjEnw8IEMdP2VH70 0zNtAOzmj58lFl5CeZhD2Xr4Lrqlwu1EmH6NhHcECBNL6ngzuamzyKIAcV+Tq8xLG4gh H/aw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0HWQx672JTmuIX2kTv0h6O3/OgxYptjsiWkrLwAfzSc=; b=hE+c8lUqV+72p3hLfZrnvNogND7t15mky7u4RuiFQNJf6k90gwmVb5kznH/S+L2IY7 ApT74ovFjNnVoE3vjbfuhvxDt1IceximHaqXdGgQ48y9d6EhKLNJnCSc1Y9U0Mwv0Gqg 9WCjaAyFsEvbovHgaJ0b4hBYc1fshXEWj+qcT8XGERtNfxPi4YEba7d8KuIc2rCK6Qow riOEYGStM0x8cocAvs081ldTFm1fB0Q6kZuTHZjFuU7CwQTpNjM9IiFcT7mvTztJZfAN z4+zYQc384NOmrUyp4cFUKbYw0NOX87PxY8lPRx9zOMR24WVslrJwlYmUyP5850e6K70 X3Bg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mxl0Kmua; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=0HWQx672JTmuIX2kTv0h6O3/OgxYptjsiWkrLwAfzSc=; b=gwhJij05enfF3MjaETmkYE2kmk2XtezAW/7+L5TWMM/I9/G1VSN0Pjmf1r0kyNRqIn uv5K4hXwrzTKDlN/quF8S8TUSQGL0VASSJvm2aCuLB3NgFyMTxqrFGVyR0791GuaY47T 8SHS5W3RE7vI+AOB6nwsYYA+d572ZATYXLJVM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=0HWQx672JTmuIX2kTv0h6O3/OgxYptjsiWkrLwAfzSc=; b=USj+pIQmtZu3AZiUED0SbrSTHvWyGF+fiMjyytbWJuWkliOlT+X/X47P6i20PylxWo l/3PnPOIhTzMHLrTp6GEzCHSVrL5ZzT1KOWqY6fOTXeOXWKwXNCfG6BpJ5CxCUqBjs/b u885GmNGb01lgGgkOvSEXqoN+Di8BK2FOYkDAie0aRRQ1DXz74c7DjmQ4Fs3kzsXHqpW 7XCIZV5OtwVJ0XLQxrtkKxNcjFe9uNFdrRJ2yik+7Bg0jIYWu8CEbWH3n4/fMKB/sSaa enEeVKwngcxIW3a+7jifiCX37di1IkepNW+bl42GzBo3YLmVOZsVgrW/zQtHpT8U5X5v luwA== X-Gm-Message-State: AOAM531/irxEPp7BM/O33Hw1fIhIke90xQ1c9O4PvIXLr/lkiJjsuG96 q60Vb/g2+u2u6jzPhPXRQ+AhbqDD X-Google-Smtp-Source: ABdhPJx1zee+7e+FxIcqrtdd8vDpZhWkfZppryS83UIqrHP4AdbYKUCNRfT8wQokrk5kGTzx6AEeeA== X-Received: by 2002:a63:6d86:: with SMTP id i128mr3622019pgc.432.1589458322786; Thu, 14 May 2020 05:12:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8f8f:: with SMTP id z15ls1010825plo.8.gmail; Thu, 14 May 2020 05:12:02 -0700 (PDT) X-Received: by 2002:a17:90a:d3d3:: with SMTP id d19mr228780pjw.42.1589458322287; Thu, 14 May 2020 05:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589458322; cv=none; d=google.com; s=arc-20160816; b=vVSz+v9sBN2VTHJkdT7rAXLMiHFA/UA1WC3Yx0dgvjDiOWTS+UCO3qgJpS6dbeHgCs 9t344Juo3sqSkfLzJ8T+KLu+pWbCn9iQRs0RlNxjkQiM7Ar7E1RxK1aa8Px1MzvYXDnq mJuAyCZAGrYxydoy5zHe1ntpaHwgauRTv8Obqbsl05fZFdyhSx819gxdEJLxq2qwbNxV Husi3zfaqU+aVHolfn4uIRqooKBHACgB0gfeUpvCRIqOeq1302xhjQeHuBg9wy9Z2KiF 3LHggN+rKeFJUosyhjmp7FmNBk1Yu2xjOwK2aiZ3BtnFzgyp8dIXVqq7/guBtuOAAl3B ILQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LQ+w0ttycYH9hAg5qVNcqFqTsm/FNMFFgTggHGQKRsw=; b=QpEEbigOWWVDrqoGz3LmonAd0ANbzjjY65nAf9xjQJxFWirHDeZZf05O9CrOi3zu4i 2ZbnzZqj+MRN+7PxIN4RMqcZidQiRkZR9qZHQCMNyhhw06UJvhg93Ymt+5l8ua+9nx0f yWH0seNcd7+m4K4kv2roqWnWqR+1Lm1ivmTUPz2vedMIXQ1bKgzG4chsy0fbORpxRDKB E35kmG8ugtpYd/O59Y8qTK3rkQnL9TTgdV3wtZXCnFZeP4KNH8aInfBDNa0fHwLCZMHc uWaIa6PBA1Ywqp0tUgtzSVzFd4B/13fD8vZ2lHVY8D6Tax5ZFZy9SyVvSU/QAm37iOxg /SWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mxl0Kmua; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j9sor27972173pjn.32.2020.05.14.05.12.02 for (Google Transport Security); Thu, 14 May 2020 05:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:ac05:: with SMTP id o5mr36931341pjq.184.1589458321968; Thu, 14 May 2020 05:12:01 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id r31sm2091050pgl.86.2020.05.14.05.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 05:11:59 -0700 (PDT) From: Jagan Teki To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Jagan Teki , Simon Glass , Vignesh R Subject: [PATCH 2/5] cmd: sf Drop reassignment of new into flash Date: Thu, 14 May 2020 17:41:42 +0530 Message-Id: <20200514121145.28737-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200514121145.28737-1-jagan@amarulasolutions.com> References: <20200514121145.28737-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mxl0Kmua; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The new pointer points to flash found and that would assign it to global 'flash' pointer for further flash operations and also keep track of old flash pointer. This would happen if the probe is successful or even failed, but current code assigning new into flash before and after checking the new. So, drop the assignment after new checks so flash always latest new pointer even if probe failed or succeed. Cc: Simon Glass Cc: Vignesh R Signed-off-by: Jagan Teki --- cmd/sf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmd/sf.c b/cmd/sf.c index e993b3e5ad..302201c2b0 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -141,13 +141,10 @@ static int do_spi_flash_probe(int argc, char * const argv[]) new = spi_flash_probe(bus, cs, speed, mode); flash = new; - if (!new) { printf("Failed to initialize SPI flash at %u:%u\n", bus, cs); return 1; } - - flash = new; #endif return 0;