diff mbox

[v4,04/15] mtd: nand: rename nand_get_flash_type() into nand_detect()

Message ID 1483448495-31607-5-git-send-email-boris.brezillon@free-electrons.com
State Accepted
Commit 7bb427990ee36482afcae859b1883e5fa1244ef2
Headers show

Commit Message

Boris Brezillon Jan. 3, 2017, 1:01 p.m. UTC
The only caller of nand_get_flash_type() (nand_scan_ident()) actually
don't use the returned nand_flash_dev pointer except for converting it to
to an error code.
Rename this function nand_detect() and make it return an integer.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/mtd/nand/nand_base.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Marek Vasut Jan. 4, 2017, 3:01 p.m. UTC | #1
On 01/03/2017 02:01 PM, Boris Brezillon wrote:
> The only caller of nand_get_flash_type() (nand_scan_ident()) actually
> don't use the returned nand_flash_dev pointer except for converting it to
> to an error code.
> Rename this function nand_detect() and make it return an integer.

Ummmm, it did return an integer before though ? The commit message is
kinda cryptic, really.

> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>  drivers/mtd/nand/nand_base.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 3a31b705af6f..efb3ade568d8 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -4010,8 +4010,7 @@ static bool find_full_id_nand(struct nand_chip *chip,
>  /*
>   * Get the flash and manufacturer id and lookup if the type is supported.
>   */
> -static int nand_get_flash_type(struct nand_chip *chip,
> -			       struct nand_flash_dev *type)
> +static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
>  {
>  	struct mtd_info *mtd = nand_to_mtd(chip);
>  	int busw;
> @@ -4368,7 +4367,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,
>  	nand_set_defaults(chip);
>  
>  	/* Read the flash type */
> -	ret = nand_get_flash_type(chip, table);
> +	ret = nand_detect(chip, table);
>  	if (ret) {
>  		if (!(chip->options & NAND_SCAN_SILENT_NODEV))
>  			pr_warn("No NAND device found\n");
>
Boris Brezillon Jan. 4, 2017, 5:03 p.m. UTC | #2
On Wed, 4 Jan 2017 16:01:42 +0100
Marek Vasut <marek.vasut@gmail.com> wrote:

> On 01/03/2017 02:01 PM, Boris Brezillon wrote:
> > The only caller of nand_get_flash_type() (nand_scan_ident()) actually
> > don't use the returned nand_flash_dev pointer except for converting it to
> > to an error code.
> > Rename this function nand_detect() and make it return an integer.  
> 
> Ummmm, it did return an integer before though ? The commit message is
> kinda cryptic, really.

Actually, that's because Masahiro changed the function prototype in one
of his patches I took for 4.10, and I forgot to adapt my commit message
when rebasing my series on Linus' tree.

I'll fix that.

Thanks,

Boris

> 
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > ---
> >  drivers/mtd/nand/nand_base.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> > index 3a31b705af6f..efb3ade568d8 100644
> > --- a/drivers/mtd/nand/nand_base.c
> > +++ b/drivers/mtd/nand/nand_base.c
> > @@ -4010,8 +4010,7 @@ static bool find_full_id_nand(struct nand_chip *chip,
> >  /*
> >   * Get the flash and manufacturer id and lookup if the type is supported.
> >   */
> > -static int nand_get_flash_type(struct nand_chip *chip,
> > -			       struct nand_flash_dev *type)
> > +static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
> >  {
> >  	struct mtd_info *mtd = nand_to_mtd(chip);
> >  	int busw;
> > @@ -4368,7 +4367,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,
> >  	nand_set_defaults(chip);
> >  
> >  	/* Read the flash type */
> > -	ret = nand_get_flash_type(chip, table);
> > +	ret = nand_detect(chip, table);
> >  	if (ret) {
> >  		if (!(chip->options & NAND_SCAN_SILENT_NODEV))
> >  			pr_warn("No NAND device found\n");
> >   
> 
>
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 3a31b705af6f..efb3ade568d8 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -4010,8 +4010,7 @@  static bool find_full_id_nand(struct nand_chip *chip,
 /*
  * Get the flash and manufacturer id and lookup if the type is supported.
  */
-static int nand_get_flash_type(struct nand_chip *chip,
-			       struct nand_flash_dev *type)
+static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
 {
 	struct mtd_info *mtd = nand_to_mtd(chip);
 	int busw;
@@ -4368,7 +4367,7 @@  int nand_scan_ident(struct mtd_info *mtd, int maxchips,
 	nand_set_defaults(chip);
 
 	/* Read the flash type */
-	ret = nand_get_flash_type(chip, table);
+	ret = nand_detect(chip, table);
 	if (ret) {
 		if (!(chip->options & NAND_SCAN_SILENT_NODEV))
 			pr_warn("No NAND device found\n");