[2/2] mtd: nand: gpmi: Kill gpmi_nand_exit()

Submitted by Boris Brezillon on April 10, 2017, 8:35 a.m.

Details

Message ID 1491813318-4417-2-git-send-email-boris.brezillon@free-electrons.com
State New
Delegated to: Boris Brezillon
Headers show

Commit Message

Boris Brezillon April 10, 2017, 8:35 a.m.
The only user of gpmi_nand_exit() is gpmi_nand_remove(). Move its content
to the caller.

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

Comments

Marek Vasut April 15, 2017, 2:58 p.m.
On 04/10/2017 10:35 AM, Boris Brezillon wrote:
> The only user of gpmi_nand_exit() is gpmi_nand_remove(). Move its content
> to the caller.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Super, thanks.

Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 92279a0d52f1..f22eeedc728f 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -1929,12 +1929,6 @@ static int gpmi_set_geometry(struct gpmi_nand_data *this)
>  	return gpmi_alloc_dma_buffer(this);
>  }
>  
> -static void gpmi_nand_exit(struct gpmi_nand_data *this)
> -{
> -	nand_release(nand_to_mtd(&this->nand));
> -	gpmi_free_dma_buffer(this);
> -}
> -
>  static int gpmi_init_last(struct gpmi_nand_data *this)
>  {
>  	struct nand_chip *chip = &this->nand;
> @@ -2131,7 +2125,8 @@ static int gpmi_nand_remove(struct platform_device *pdev)
>  {
>  	struct gpmi_nand_data *this = platform_get_drvdata(pdev);
>  
> -	gpmi_nand_exit(this);
> +	nand_release(nand_to_mtd(&this->nand));
> +	gpmi_free_dma_buffer(this);
>  	release_resources(this);
>  	return 0;
>  }
>
Han Xu April 17, 2017, 4:55 p.m.
On Sat, Apr 15, 2017 at 9:58 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
>
> On 04/10/2017 10:35 AM, Boris Brezillon wrote:
> > The only user of gpmi_nand_exit() is gpmi_nand_remove(). Move its content
> > to the caller.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>
> Super, thanks.
>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

Acked-by: Han Xu <han.xu@nxp.com>
>
>
> > ---
> >  drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 9 ++-------
> >  1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > index 92279a0d52f1..f22eeedc728f 100644
> > --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > @@ -1929,12 +1929,6 @@ static int gpmi_set_geometry(struct gpmi_nand_data *this)
> >       return gpmi_alloc_dma_buffer(this);
> >  }
> >
> > -static void gpmi_nand_exit(struct gpmi_nand_data *this)
> > -{
> > -     nand_release(nand_to_mtd(&this->nand));
> > -     gpmi_free_dma_buffer(this);
> > -}
> > -
> >  static int gpmi_init_last(struct gpmi_nand_data *this)
> >  {
> >       struct nand_chip *chip = &this->nand;
> > @@ -2131,7 +2125,8 @@ static int gpmi_nand_remove(struct platform_device *pdev)
> >  {
> >       struct gpmi_nand_data *this = platform_get_drvdata(pdev);
> >
> > -     gpmi_nand_exit(this);
> > +     nand_release(nand_to_mtd(&this->nand));
> > +     gpmi_free_dma_buffer(this);
> >       release_resources(this);
> >       return 0;
> >  }
> >
>
>
> --
> Best regards,
> Marek Vasut
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

Patch hide | download patch | download mbox

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 92279a0d52f1..f22eeedc728f 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1929,12 +1929,6 @@  static int gpmi_set_geometry(struct gpmi_nand_data *this)
 	return gpmi_alloc_dma_buffer(this);
 }
 
-static void gpmi_nand_exit(struct gpmi_nand_data *this)
-{
-	nand_release(nand_to_mtd(&this->nand));
-	gpmi_free_dma_buffer(this);
-}
-
 static int gpmi_init_last(struct gpmi_nand_data *this)
 {
 	struct nand_chip *chip = &this->nand;
@@ -2131,7 +2125,8 @@  static int gpmi_nand_remove(struct platform_device *pdev)
 {
 	struct gpmi_nand_data *this = platform_get_drvdata(pdev);
 
-	gpmi_nand_exit(this);
+	nand_release(nand_to_mtd(&this->nand));
+	gpmi_free_dma_buffer(this);
 	release_resources(this);
 	return 0;
 }