public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: 'Brian Norris' <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org, 'Jingoo Han' <jg1.han@samsung.com>,
	'David Woodhouse' <dwmw2@infradead.org>,
	'Vitaly Wool' <vitalywool@gmail.com>
Subject: Re: [PATCH 7/8] mtd: plat_nand: Use devm_*() functions
Date: Fri, 03 Jan 2014 10:27:53 +0900	[thread overview]
Message-ID: <000501cf0823$0658bc70$130a3550$%han@samsung.com> (raw)
In-Reply-To: <20140103010445.GA5631@ld-irv-0074>

On Friday, January 03, 2014 10:18 AM, Jingoo Han wrote:
> On Fri, Dec 20, 2013 at 02:04:29PM +0900, Jingoo Han wrote:
> > --- a/drivers/mtd/nand/plat_nand.c
> > +++ b/drivers/mtd/nand/plat_nand.c
> > @@ -52,25 +52,16 @@ static int plat_nand_probe(struct platform_device *pdev)
> >  		return -ENXIO;
> >
> >  	/* Allocate memory for the device structure (and zero it) */
> > -	data = kzalloc(sizeof(struct plat_nand_data), GFP_KERNEL);
> > +	data = devm_kzalloc(&pdev->dev, sizeof(struct plat_nand_data),
> > +			    GFP_KERNEL);
> >  	if (!data) {
> >  		dev_err(&pdev->dev, "failed to allocate device structure.\n");
> >  		return -ENOMEM;
> >  	}
> >
> > -	if (!request_mem_region(res->start, resource_size(res),
> > -				dev_name(&pdev->dev))) {
> > -		dev_err(&pdev->dev, "request_mem_region failed\n");
> > -		err = -EBUSY;
> > -		goto out_free;
> > -	}
> > -
> > -	data->io_base = ioremap(res->start, resource_size(res));
> > -	if (data->io_base == NULL) {
> > -		dev_err(&pdev->dev, "ioremap failed\n");
> > -		err = -EIO;
> > -		goto out_release_io;
> > -	}
> > +	data->io_base = devm_ioremap_resource(&pdev->dev, res);
> > +	if (IS_ERR(data->io_base))
> > +		return PTR_ERR(data->io_base);
> 
> This gives me a few errors:
> 
> drivers/mtd/nand/plat_nand.c: In function 'plat_nand_probe':
> drivers/mtd/nand/plat_nand.c:61:2: error: implicit declaration of function 'IS_ERR' [-Werror=implicit-
> function-declaration]
> drivers/mtd/nand/plat_nand.c:62:3: error: implicit declaration of function 'PTR_ERR' [-
> Werror=implicit-function-declaration]
> make[4]: *** [drivers/mtd/nand/plat_nand.o] Error 1
> 
> You probably need to #include <linux/err.h>. I guess you don't
> compile-test your changes? It would help if you can catch these mistakes
> before they get to the maintainer.

Hi Norris,

I did compile all patches. However, I cannot understand why the build
error happens. Anyway, I will check it and add '#include <linux/err.h'
if needed.

Thank you for your comment. :-)
Happy new year!

Best regards,
Jingoo Han

  parent reply	other threads:[~2014-01-03  1:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20  4:53 [PATCH 1/8] mtd: docg3: Use devm_*() functions Jingoo Han
2013-12-20  4:56 ` [PATCH 2/8] mtd: ixp4xx: " Jingoo Han
2014-01-03  1:19   ` Brian Norris
2013-12-20  4:58 ` [PATCH 3/8] mtd: lantiq-flash: Use devm_kzalloc() Jingoo Han
2013-12-20  6:03   ` John Crispin
2013-12-20  7:14     ` Jingoo Han
2013-12-20  5:00 ` [PATCH 4/8] mtd: denali_dt: Use devm_clk_get() Jingoo Han
2013-12-20  5:01 ` [PATCH 5/8] mtd: lpc32xx_slc: Use devm_*() functions Jingoo Han
2013-12-20  5:02 ` [PATCH 6/8] mtd: nuc900_nand: " Jingoo Han
2013-12-20  5:04 ` [PATCH 7/8] mtd: plat_nand: " Jingoo Han
2014-01-03  1:17   ` Brian Norris
2014-01-03  1:21     ` Brian Norris
2014-01-03  1:27     ` Jingoo Han [this message]
2014-01-03 18:16       ` Brian Norris
2013-12-20  5:05 ` [PATCH 8/8] mtd: tmio_nand: " Jingoo Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000501cf0823$0658bc70$130a3550$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vitalywool@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox