From patchwork Thu May 1 09:56:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 29456 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BBCCD203F3 for ; Thu, 1 May 2014 09:57:35 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf15462951oac.11 for ; Thu, 01 May 2014 02:57:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=OZ98FkVwCCZEWU6UhbT3IOufe4yIrZfiLC3xTwlseBA=; b=ct6S2VaH7uVBJJS7rDwdqcshaWvODxLjTKU4Jt42HvUdxmanJjg95L22BUZ0fPwLQX kYjHMh7++fPvIsCAmDK5feDpqYuxecj4ExArHoBo1wRAMkGa1hUgHSxAzuIxb5YC2cDE fAIXUPuLJIoHDuWzvcwPzxMXYMByUVoJawdIMHPF7X4Gt4g0kQDk3m7UYBtXQ0JvsLHb PzgG4Hb0PAq+qYzufdpHdFVePGWXntQBabOhXUhFVvFXDcozEPr/RVr3Yi3qbWSao4SE yJ/+SDytqrKuRAiYAqx8FCvFvibJJ5DDih0Aqc7qLzkh/0E6yvAi6R9iujjso5/XS97q N/3Q== X-Gm-Message-State: ALoCoQkfIpC6mSupfQ4wjnre+6LFjpkWsVy/w7Io3TuopK0cCBKS3QdLxvntH6+/Jp8+XZ22JgqM X-Received: by 10.50.51.68 with SMTP id i4mr827886igo.5.1398938255271; Thu, 01 May 2014 02:57:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.231 with SMTP id q94ls1009109qga.28.gmail; Thu, 01 May 2014 02:57:35 -0700 (PDT) X-Received: by 10.58.171.229 with SMTP id ax5mr8420882vec.24.1398938255183; Thu, 01 May 2014 02:57:35 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id ck5si5956880vdd.37.2014.05.01.02.57.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 May 2014 02:57:35 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id ld13so3749010vcb.30 for ; Thu, 01 May 2014 02:57:35 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr8299132vcx.12.1398938255105; Thu, 01 May 2014 02:57:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp12912vcb; Thu, 1 May 2014 02:57:34 -0700 (PDT) X-Received: by 10.180.76.244 with SMTP id n20mr1579879wiw.4.1398938253735; Thu, 01 May 2014 02:57:33 -0700 (PDT) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by mx.google.com with ESMTPS id la10si10547772wjb.31.2014.05.01.02.57.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 May 2014 02:57:33 -0700 (PDT) Received-SPF: none (google.com: lee.jones@linaro.org does not designate permitted sender hosts) client-ip=74.125.82.174; Received: by mail-we0-f174.google.com with SMTP id k48so2910862wev.33 for ; Thu, 01 May 2014 02:57:33 -0700 (PDT) X-Received: by 10.181.8.204 with SMTP id dm12mr1485755wid.1.1398938253252; Thu, 01 May 2014 02:57:33 -0700 (PDT) Received: from lee--X1.home (host109-148-238-223.range109-148.btcentralplus.com. [109.148.238.223]) by mx.google.com with ESMTPSA id bj5sm2696494wib.3.2014.05.01.02.57.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 May 2014 02:57:32 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: computersforpeace@gmail.com, linux-mtd@lists.infradead.org, kernel@stlinux.com, Lee Jones Subject: [PATCH 13/47] mtd: nand: stm_nand_bch: scan for NAND devices Date: Thu, 1 May 2014 10:56:20 +0100 Message-Id: <1398938214-17847-14-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398938214-17847-1-git-send-email-lee.jones@linaro.org> References: <1398938214-17847-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Use the core nand_scan_ident() routine to locate connected NAND chips. Signed-off-by: Lee Jones --- drivers/mtd/nand/stm_nand_bch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mtd/nand/stm_nand_bch.c b/drivers/mtd/nand/stm_nand_bch.c index 8a63c4a..2670cec 100644 --- a/drivers/mtd/nand/stm_nand_bch.c +++ b/drivers/mtd/nand/stm_nand_bch.c @@ -532,6 +532,7 @@ static int stm_nand_bch_probe(struct platform_device *pdev) struct nandi_info *info; struct nand_chip *chip; struct mtd_info *mtd; + int err; nandi = nandi_init_resources(pdev); if (IS_ERR(nandi)) { @@ -556,6 +557,10 @@ static int stm_nand_bch_probe(struct platform_device *pdev) nandi_set_mtd_defaults(nandi, mtd, chip); + err = nand_scan_ident(mtd, 1, NULL); + if (err) + return err; + return 0; } @@ -563,6 +568,8 @@ static int stm_nand_bch_remove(struct platform_device *pdev) { struct nandi_controller *nandi = platform_get_drvdata(pdev); + nand_release(&nandi->info.mtd); + nandi_clk_disable(nandi); return 0;