From patchwork Thu Jul 28 17:17:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2284 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BE3763F081 for ; Thu, 28 Jul 2022 19:17:57 +0200 (CEST) Received: by mail-wr1-f72.google.com with SMTP id u17-20020adfa191000000b0021ed2209fccsf588845wru.16 for ; Thu, 28 Jul 2022 10:17:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659028677; cv=pass; d=google.com; s=arc-20160816; b=Nifj3JyrcGGj6T28RHCgX3B4srfWJNaUoZC7SVqZeZEdPrQPlPHvlEhbFG6WB7ILIn vknlYBd7DtUdfO77vlmiPhxKoUhPNKc1Dq2VULrJjajG47oJtusvJEvkdlWtwXrbiVMk 88xt/TaN70YYTdjkpBoPlECa9Mr0NTYEUAd7EmYyEyEY1w7RqRhVJPSOqSPW3NKDR78r O9Y3G9wcq+S3Xi0AaTPvjQ4mSDpGbd3qPeuqfUOEDBxHfxRZGlqvTH8X6jd1J27qXTiD 0Vbw58Cx13Up/D3fF6LY6bn68gcenCLpyKUw6IP07WRaV3G3nNe0L9sXAYsHKcAKmOi7 2Epg== 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=XfiYpw742R99I+sR6kCX8V3TL5nZt8MlhBdcN1C40pc=; b=ehU4yUMPyHWJ/Wn7yJUiMBLIDaQ2jhng8SeqkLc4olrFxk2yPJJoaNi3V5un+iGmbm dpXSDT2FzSMEjYaPj71EIFxscQXwZZPEg8P8as2jv3kCJKGdhGGTtqFzg5OSeD+ZTWyr Mxy3ch0CFepkeGpueAnUiBP54hBYGa3529KNCCKxW5gs3GytlK0tTw8nFJ0JYxaWxw+H 2tqoELpfEmQml2V/OJPxmjHyVlih5OzO6e5WUVLe8k4Kc4wpoxAv3p2d3hqIh5GTFW+E 0orQdXSjBc+4RqFv1f3SGoy9VL9aDLkUr4u6tJLWqm9o45EHZJqh76Lol2ofjq/8UklR E4mg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JR84fN0P; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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=XfiYpw742R99I+sR6kCX8V3TL5nZt8MlhBdcN1C40pc=; b=cnfa/Q4IV0o74GCsipLmuvjlLJ+FwYa2RseMq7U06OEfY3bOXWzmbXPjN02fN24MdF DB1Ci60moPPBk+R4a+bLMEKdzIcX5FHV2ToRStnJI44wsWLxkhJlDeVafvsWG42YLqXU GO6OW0ahQMnwsyEqcel3/E0tnjLnLBNSsPGP8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XfiYpw742R99I+sR6kCX8V3TL5nZt8MlhBdcN1C40pc=; b=fa8C4ZjbPoRS+tKcfmjLEY9NNu7H0isokvpcIVq9zVhmNhL7Uk8z0a3M3HNGcRZYSW KhAL+QqjMKc9nLtpTglwvtiM17yIZL9plCz68Z03nxoQEZVdySUkJVNBVSZo5fPmlAAc CM+iT7HH6fp7UqoafYViN3EiGJlt6CVt6Vm89u0P7uY9Y336oMy/O8LKQT4CjWKHPq0C qdVlXeRUIY64PQBvbJaAOhUKfg+lpQHw7C8SIAPJt0eGCDsmGK7zuXgchmpq/8ZM5IO6 Nn3O2XzjLUP2xxudLXxSxK7l6MgiVY0+jLy5OYG62lEfbYZrtET4iTfhoADGhyLYfI+N UWXg== X-Gm-Message-State: AJIora+g34CCyl8z71jXBgu0dYr1PsO/G5zsBxKF9ZOMSoqcXlKB8j/t oBMj8N8RPibrjGBZRp7OdhXCidl1 X-Google-Smtp-Source: AGRyM1sUIwsGwaAL81IpSEnKISHhHBHPbP1gxUL0qYEe3cmvLjPIQOat+KNn6xvUt+6gbre76pUXVg== X-Received: by 2002:adf:d1e8:0:b0:21d:ac9c:983d with SMTP id g8-20020adfd1e8000000b0021dac9c983dmr17842339wrd.629.1659028677530; Thu, 28 Jul 2022 10:17:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:adf:d216:0:b0:21e:e644:c8 with SMTP id j22-20020adfd216000000b0021ee64400c8ls2530232wrh.3.-pod-prod-gmail; Thu, 28 Jul 2022 10:17:56 -0700 (PDT) X-Received: by 2002:a5d:5983:0:b0:21d:a811:3b41 with SMTP id n3-20020a5d5983000000b0021da8113b41mr17264717wri.441.1659028676233; Thu, 28 Jul 2022 10:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659028676; cv=none; d=google.com; s=arc-20160816; b=iaDNThAizT0QG0izRFHLreacv+m09cNsQ9GRLJMqwM2yIcOBPwLG/qARgDFjOuFJAK 5oRlzqkBmXYhMVI07SpLmUjtp/6BQ5zrE53cNoPcZwnT+C1HcabTbACHTfEHLTcC+jP4 Gt9kThvPqel7HkIwUiRoNbMtVjNXqwkrIhENVUbOkQ4D2CAmAJbFMJo/wpj+qr1DIE0H ynYp3Y6G/2q684ERKljdbBvSjPZkrdSWkjlirdqtEBTE+khqazDzAjMzVyQOEYgps0MH LIZ2o8Th7Z6Bp2mGO74qESBWE09l1IXvxcNSma2Y+GcFE8VVUj9NdaYgzUSs5pn2Y4dN 5lDg== 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=CI0oQyRsfK2N+rtSL2jBaNF2DJpRRtmM1V8IJkNG9no=; b=fTRZ3myUW3KkmcC03lN7u1AHUd9x7zgODTjiWVZ/eyaAHMBb81UZMw/p5+NGSjq1wI fw/IakEd2FL46g7pcVWLbYNJ+xoQ39S1IKX+yJs/ntq6REERh4yw4wr2EjB9bqTUGCzd xdKWn01431+4d5bLzwVBvv4Ka1KtVsa0X+nd3YwudkJRx5gYkHQ/Xwl4a8CxPi+lC58g 9xxOf1endDIMaCeZw0VlKRHzjJlQO5CMyum4KwefzctrXr9i30N59ifpyEYnQ1Y8Z6Wz 4R+amQk01Air0pwnBES33qORAjGjqoEMQAPAw4oOCgGKAiT/vX/2VuD5SWcxkLeNs3ap 6RNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JR84fN0P; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id e4-20020adfc844000000b0021b8bba9110sor740883wrh.71.2022.07.28.10.17.56 for (Google Transport Security); Thu, 28 Jul 2022 10:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:adf:fe42:0:b0:21f:8df:2239 with SMTP id m2-20020adffe42000000b0021f08df2239mr1951068wrs.644.1659028675672; Thu, 28 Jul 2022 10:17:55 -0700 (PDT) Received: from panicking.amarulasolutions.com ([2.196.208.4]) by smtp.gmail.com with ESMTPSA id h3-20020a5d4fc3000000b0021eba590ad1sm1667850wrw.90.2022.07.28.10.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 10:17:54 -0700 (PDT) From: Michael Trimarchi To: Dario Binacchi , u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Tommaso Merciai , Weijie Gao , GSS_MTK_Uboot_upstream , Patrice Chotard , Wolfgang Denk , Simon Glass Subject: [PATCH 3/5] mtd: nand: Rename nand_get_flash_type() into nand_detect() Date: Thu, 28 Jul 2022 19:17:41 +0200 Message-Id: <20220728171744.1761739-4-michael@amarulasolutions.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220728171744.1761739-1-michael@amarulasolutions.com> References: <20220728171744.1761739-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JR84fN0P; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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: , Upstream linux commit 7bb427990ee364. Rename the function to match this new behavior. NOTE: fix nand_detect/nand_get_flash_type parameters in mxs_nand_spl. This code seems never executed by any board as alternative for nand detect Signed-off-by: Michael Trimarchi --- drivers/mtd/nand/raw/mt7621_nand.c | 3 +-- drivers/mtd/nand/raw/mxs_nand_spl.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 11 +++++------ include/linux/mtd/rawnand.h | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/nand/raw/mt7621_nand.c b/drivers/mtd/nand/raw/mt7621_nand.c index a4a0bce35d..f6eddb84a9 100644 --- a/drivers/mtd/nand/raw/mt7621_nand.c +++ b/drivers/mtd/nand/raw/mt7621_nand.c @@ -1186,8 +1186,7 @@ int mt7621_nfc_spl_post_init(struct mt7621_nfc *nfc) int nand_maf_id, nand_dev_id; int ret; - ret = nand_get_flash_type(nand, &nand_maf_id, - &nand_dev_id, NULL); + ret = nand_detect(nand, &nand_maf_id, &nand_dev_id, NULL); if (ret) return ret; diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c index 773d375fc2..ef03b7789d 100644 --- a/drivers/mtd/nand/raw/mxs_nand_spl.c +++ b/drivers/mtd/nand/raw/mxs_nand_spl.c @@ -83,7 +83,7 @@ static int mxs_flash_full_ident(struct mtd_info *mtd) struct nand_chip *chip = mtd_to_nand(mtd); int ret; - ret = nand_get_flash_type(mtd, chip, &nand_maf_id, &nand_dev_id, NULL); + ret = nand_detect(chip, &nand_maf_id, &nand_dev_id, NULL); if (ret) { chip->select_chip(mtd, -1); diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index b4fa618dc4..1a1a757932 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -4276,8 +4276,8 @@ static const struct nand_manufacturer *nand_get_manufacturer_desc(u8 id) /* * Get the flash and manufacturer id and lookup if the type is supported. */ -int nand_get_flash_type(struct nand_chip *chip, int *maf_id, - int *dev_id, struct nand_flash_dev *type) +int nand_detect(struct nand_chip *chip, int *maf_id, + int *dev_id, struct nand_flash_dev *type) { struct mtd_info *mtd = &chip->mtd; const struct nand_manufacturer *manufacturer_desc; @@ -4461,7 +4461,7 @@ ident_done: mtd->erasesize >> 10, mtd->writesize, mtd->oobsize); return 0; } -EXPORT_SYMBOL(nand_get_flash_type); +EXPORT_SYMBOL(nand_detect); #if CONFIG_IS_ENABLED(OF_CONTROL) @@ -4558,8 +4558,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, nand_set_defaults(chip, chip->options & NAND_BUSWIDTH_16); /* Read the flash type */ - ret = nand_get_flash_type(chip, &nand_maf_id, - &nand_dev_id, table); + ret = nand_detect(chip, &nand_maf_id, &nand_dev_id, table); if (ret) { if (!(chip->options & NAND_SCAN_SILENT_NODEV)) @@ -4591,7 +4590,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, for (i = 1; i < maxchips; i++) { u8 id[2]; - /* See comment in nand_get_flash_type for reset */ + /* See comment in nand_detect for reset */ nand_reset(chip, i); chip->select_chip(mtd, i); diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 8178f36b49..fb002ae641 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -29,8 +29,8 @@ struct nand_flash_dev; struct device_node; /* Get the flash and manufacturer id and lookup if the type is supported. */ -int nand_get_flash_type(struct nand_chip *chip, int *maf_id, int *dev_id, - struct nand_flash_dev *type); +int nand_detect(struct nand_chip *chip, int *maf_id, int *dev_id, + struct nand_flash_dev *type); /* Scan and identify a NAND device */ int nand_scan(struct mtd_info *mtd, int max_chips);