* [PATCH] mtd: nand: pasemi: switch to pr_* functions
@ 2016-04-08 10:33 Rafał Miłecki
2016-04-08 10:50 ` Joe Perches
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Rafał Miłecki @ 2016-04-08 10:33 UTC (permalink / raw)
To: Boris Brezillon
Cc: Richard Weinberger, linux-mtd, Rafał Miłecki,
Olof Johansson, David Woodhouse, Brian Norris,
open list:LINUX FOR POWERPC PA SEMI PWRFICIENT, open list
This patch also replaces %08llx with %08zx for printing resource start
address. Old format was triggering:
warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/mtd/nand/pasemi_nand.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index 63fcb8c..e928549 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -112,8 +112,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
/* Allocate memory for MTD device structure and private data */
chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
if (!chip) {
- printk(KERN_WARNING
- "Unable to allocate PASEMI NAND MTD device structure\n");
+ pr_warn("Unable to allocate PASEMI NAND MTD device structure\n");
err = -ENOMEM;
goto out;
}
@@ -163,13 +162,13 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
}
if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
- printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
+ pr_err("pasemi_nand: Unable to register MTD device\n");
err = -ENODEV;
goto out_lpc;
}
- printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
- res.start, lpcctl);
+ pr_info("PA Semi NAND flash at %08zx, control at I/O %x\n", res.start,
+ lpcctl);
return 0;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] mtd: nand: pasemi: switch to pr_* functions
2016-04-08 10:33 [PATCH] mtd: nand: pasemi: switch to pr_* functions Rafał Miłecki
@ 2016-04-08 10:50 ` Joe Perches
2016-04-08 10:52 ` kbuild test robot
2016-04-08 11:13 ` [PATCH V2] " Rafał Miłecki
2 siblings, 0 replies; 9+ messages in thread
From: Joe Perches @ 2016-04-08 10:50 UTC (permalink / raw)
To: Rafał Miłecki, Boris Brezillon
Cc: Richard Weinberger, linux-mtd, Olof Johansson, David Woodhouse,
Brian Norris, open list:LINUX FOR POWERPC PA SEMI PWRFICIENT,
open list
On Fri, 2016-04-08 at 12:33 +0200, Rafał Miłecki wrote:
> This patch also replaces %08llx with %08zx for printing resource start
> address. Old format was triggering:
> warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
trivia:
> diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
[]
> @@ -112,8 +112,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> /* Allocate memory for MTD device structure and private data */
> chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
> if (!chip) {
> - printk(KERN_WARNING
> - "Unable to allocate PASEMI NAND MTD device structure\n");
> + pr_warn("Unable to allocate PASEMI NAND MTD device structure\n");
Maybe remove this unnecessary as there's an OOM stack dump.
> err = -ENOMEM;
> goto out;
> }
> @@ -163,13 +162,13 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> }
>
> if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
> - printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
> + pr_err("pasemi_nand: Unable to register MTD device\n");
Maybe remove the embedded "pasemi_nand: " and add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before the first #include?
> err = -ENODEV;
> goto out_lpc;
> }
>
> - printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
> - res.start, lpcctl);
> + pr_info("PA Semi NAND flash at %08zx, control at I/O %x\n", res.start,
> + lpcctl);
Maybe use %pR, &res instead of res.start?
pr_info("PA Semi NAND flash at %pR, control at I/O %x\n", &res, lpcctl);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mtd: nand: pasemi: switch to pr_* functions
2016-04-08 10:33 [PATCH] mtd: nand: pasemi: switch to pr_* functions Rafał Miłecki
2016-04-08 10:50 ` Joe Perches
@ 2016-04-08 10:52 ` kbuild test robot
2016-04-08 11:13 ` [PATCH V2] " Rafał Miłecki
2 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2016-04-08 10:52 UTC (permalink / raw)
To: Rafał Miłecki
Cc: kbuild-all, Boris Brezillon, Richard Weinberger,
Rafał Miłecki,
open list:LINUX FOR POWERPC PA SEMI PWRFICIENT, open list,
linux-mtd, Olof Johansson, Brian Norris, David Woodhouse
[-- Attachment #1: Type: text/plain, Size: 2912 bytes --]
Hi Rafał,
[auto build test WARNING on mtd/master]
[also build test WARNING on v4.6-rc2 next-20160408]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/mtd-nand-pasemi-switch-to-pr_-functions/20160408-183554
base: git://git.infradead.org/linux-mtd.git master
config: powerpc-allmodconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All warnings (new ones prefixed by >>):
In file included from include/linux/printk.h:6:0,
from include/linux/kernel.h:13,
from include/asm-generic/bug.h:13,
from arch/powerpc/include/asm/bug.h:127,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from include/linux/slab.h:14,
from drivers/mtd/nand/pasemi_nand.c:25:
drivers/mtd/nand/pasemi_nand.c: In function 'pasemi_nand_probe':
include/linux/kern_levels.h:4:18: warning: format '%zx' expects argument of type 'size_t', but argument 2 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^
include/linux/printk.h:259:9: note: in expansion of macro 'KERN_INFO'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
>> drivers/mtd/nand/pasemi_nand.c:169:2: note: in expansion of macro 'pr_info'
pr_info("PA Semi NAND flash at %08zx, control at I/O %x\n", res.start,
^
vim +/pr_info +169 drivers/mtd/nand/pasemi_nand.c
153
154 /* Enable the following for a flash based bad block table */
155 chip->bbt_options = NAND_BBT_USE_FLASH;
156
157 /* Scan to find existence of the device */
158 if (nand_scan(pasemi_nand_mtd, 1)) {
159 err = -ENXIO;
160 goto out_lpc;
161 }
162
163 if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
164 pr_err("pasemi_nand: Unable to register MTD device\n");
165 err = -ENODEV;
166 goto out_lpc;
167 }
168
> 169 pr_info("PA Semi NAND flash at %08zx, control at I/O %x\n", res.start,
170 lpcctl);
171
172 return 0;
173
174 out_lpc:
175 release_region(lpcctl, 4);
176 out_ior:
177 iounmap(chip->IO_ADDR_R);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 48562 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH V2] mtd: nand: pasemi: switch to pr_* functions
2016-04-08 10:33 [PATCH] mtd: nand: pasemi: switch to pr_* functions Rafał Miłecki
2016-04-08 10:50 ` Joe Perches
2016-04-08 10:52 ` kbuild test robot
@ 2016-04-08 11:13 ` Rafał Miłecki
2016-04-08 16:49 ` Joe Perches
` (2 more replies)
2 siblings, 3 replies; 9+ messages in thread
From: Rafał Miłecki @ 2016-04-08 11:13 UTC (permalink / raw)
To: Boris Brezillon
Cc: Richard Weinberger, linux-mtd, Egor Martovetsky, Olof Johansson,
Joe Perches, Rafał Miłecki, David Woodhouse,
Brian Norris, open list:LINUX FOR POWERPC PA SEMI PWRFICIENT,
open list
1) Use pr_fmt to keep messages consistent
2) Don't warn if kzalloc fails as it dumps stack on its own
3) Use %pR format for displaying whole resource to avoid:
warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/mtd/nand/pasemi_nand.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index 63fcb8c..e8372b4 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -22,6 +22,8 @@
#undef DEBUG
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
@@ -112,8 +114,6 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
/* Allocate memory for MTD device structure and private data */
chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
if (!chip) {
- printk(KERN_WARNING
- "Unable to allocate PASEMI NAND MTD device structure\n");
err = -ENOMEM;
goto out;
}
@@ -163,13 +163,12 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
}
if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
- printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
+ pr_err("Unable to register MTD device\n");
err = -ENODEV;
goto out_lpc;
}
- printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
- res.start, lpcctl);
+ pr_info("PA Semi NAND flash at %pR, control at I/O %x\n", &res, lpcctl);
return 0;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH V2] mtd: nand: pasemi: switch to pr_* functions
2016-04-08 11:13 ` [PATCH V2] " Rafał Miłecki
@ 2016-04-08 16:49 ` Joe Perches
2016-04-09 9:50 ` Andy Shevchenko
2016-04-13 9:48 ` [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions Rafał Miłecki
2 siblings, 0 replies; 9+ messages in thread
From: Joe Perches @ 2016-04-08 16:49 UTC (permalink / raw)
To: Rafał Miłecki, Boris Brezillon
Cc: Richard Weinberger, linux-mtd, Egor Martovetsky, Olof Johansson,
David Woodhouse, Brian Norris,
open list:LINUX FOR POWERPC PA SEMI PWRFICIENT, open list
On Fri, 2016-04-08 at 13:13 +0200, Rafał Miłecki wrote:
> 1) Use pr_fmt to keep messages consistent
> 2) Don't warn if kzalloc fails as it dumps stack on its own
> 3) Use %pR format for displaying whole resource to avoid:
> warning: format ‘%08llx’ expects type ‘long long unsigned int’, but
> argument 2 has type ‘resource_size_t’
thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] mtd: nand: pasemi: switch to pr_* functions
2016-04-08 11:13 ` [PATCH V2] " Rafał Miłecki
2016-04-08 16:49 ` Joe Perches
@ 2016-04-09 9:50 ` Andy Shevchenko
2016-04-13 7:44 ` Boris Brezillon
2016-04-13 9:48 ` [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions Rafał Miłecki
2 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2016-04-09 9:50 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Boris Brezillon, Richard Weinberger,
open list:MEMORY TECHNOLOGY...,
Egor Martovetsky, Olof Johansson, Joe Perches, David Woodhouse,
Brian Norris, open list:LINUX FOR POWERPC PA SEMI PWRFICIENT,
open list
On Fri, Apr 8, 2016 at 2:13 PM, Rafał Miłecki <zajec5@gmail.com> wrote:
> 1) Use pr_fmt to keep messages consistent
> 2) Don't warn if kzalloc fails as it dumps stack on its own
> 3) Use %pR format for displaying whole resource to avoid:
> warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
> drivers/mtd/nand/pasemi_nand.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
> index 63fcb8c..e8372b4 100644
> --- a/drivers/mtd/nand/pasemi_nand.c
> +++ b/drivers/mtd/nand/pasemi_nand.c
> @@ -22,6 +22,8 @@
>
> #undef DEBUG
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/slab.h>
> #include <linux/module.h>
> #include <linux/mtd/mtd.h>
> @@ -112,8 +114,6 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> /* Allocate memory for MTD device structure and private data */
> chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
> if (!chip) {
> - printk(KERN_WARNING
> - "Unable to allocate PASEMI NAND MTD device structure\n");
> err = -ENOMEM;
> goto out;
> }
> @@ -163,13 +163,12 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> }
>
> if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
> - printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
> + pr_err("Unable to register MTD device\n");
And why not to use dev_err(&ofdev->dev, …); ?
> err = -ENODEV;
> goto out_lpc;
> }
>
> - printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
> - res.start, lpcctl);
> + pr_info("PA Semi NAND flash at %pR, control at I/O %x\n", &res, lpcctl);
>
Ditto.
> return 0;
>
> --
> 1.8.4.5
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] mtd: nand: pasemi: switch to pr_* functions
2016-04-09 9:50 ` Andy Shevchenko
@ 2016-04-13 7:44 ` Boris Brezillon
0 siblings, 0 replies; 9+ messages in thread
From: Boris Brezillon @ 2016-04-13 7:44 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafał Miłecki, Richard Weinberger,
open list:MEMORY TECHNOLOGY...,
Egor Martovetsky, Olof Johansson, Joe Perches, David Woodhouse,
Brian Norris, open list:LINUX FOR POWERPC PA SEMI PWRFICIENT,
open list
Hi,
On Sat, 9 Apr 2016 12:50:35 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Fri, Apr 8, 2016 at 2:13 PM, Rafał Miłecki <zajec5@gmail.com> wrote:
> > 1) Use pr_fmt to keep messages consistent
> > 2) Don't warn if kzalloc fails as it dumps stack on its own
> > 3) Use %pR format for displaying whole resource to avoid:
> > warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
> >
> > Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> > ---
> > drivers/mtd/nand/pasemi_nand.c | 9 ++++-----
> > 1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
> > index 63fcb8c..e8372b4 100644
> > --- a/drivers/mtd/nand/pasemi_nand.c
> > +++ b/drivers/mtd/nand/pasemi_nand.c
> > @@ -22,6 +22,8 @@
> >
> > #undef DEBUG
> >
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > +
> > #include <linux/slab.h>
> > #include <linux/module.h>
> > #include <linux/mtd/mtd.h>
> > @@ -112,8 +114,6 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> > /* Allocate memory for MTD device structure and private data */
> > chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
> > if (!chip) {
> > - printk(KERN_WARNING
> > - "Unable to allocate PASEMI NAND MTD device structure\n");
> > err = -ENOMEM;
> > goto out;
> > }
> > @@ -163,13 +163,12 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> > }
> >
> > if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
> > - printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
> > + pr_err("Unable to register MTD device\n");
>
> And why not to use dev_err(&ofdev->dev, …); ?
Yep, I think it's better to use dev_err().
Best Regards,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions
2016-04-08 11:13 ` [PATCH V2] " Rafał Miłecki
2016-04-08 16:49 ` Joe Perches
2016-04-09 9:50 ` Andy Shevchenko
@ 2016-04-13 9:48 ` Rafał Miłecki
2016-04-13 11:54 ` Boris Brezillon
2 siblings, 1 reply; 9+ messages in thread
From: Rafał Miłecki @ 2016-04-13 9:48 UTC (permalink / raw)
To: Boris Brezillon
Cc: Richard Weinberger, linux-mtd, Egor Martovetsky, Olof Johansson,
Joe Perches, Rafał Miłecki, David Woodhouse,
Brian Norris, open list:LINUX FOR POWERPC PA SEMI PWRFICIENT,
open list
It also contains some minor related changes:
1) Don't warn if kzalloc fails as it dumps stack on its own
2) Use %pR format for displaying whole resource to avoid:
warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
V3: Switch to dev_* instead of pr_*
---
drivers/mtd/nand/pasemi_nand.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index 63fcb8c..5de7591 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -92,8 +92,9 @@ int pasemi_device_ready(struct mtd_info *mtd)
static int pasemi_nand_probe(struct platform_device *ofdev)
{
+ struct device *dev = &ofdev->dev;
struct pci_dev *pdev;
- struct device_node *np = ofdev->dev.of_node;
+ struct device_node *np = dev->of_node;
struct resource res;
struct nand_chip *chip;
int err = 0;
@@ -107,13 +108,11 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
if (pasemi_nand_mtd)
return -ENODEV;
- pr_debug("pasemi_nand at %pR\n", &res);
+ dev_dbg(dev, "pasemi_nand at %pR\n", &res);
/* Allocate memory for MTD device structure and private data */
chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
if (!chip) {
- printk(KERN_WARNING
- "Unable to allocate PASEMI NAND MTD device structure\n");
err = -ENOMEM;
goto out;
}
@@ -121,7 +120,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
pasemi_nand_mtd = nand_to_mtd(chip);
/* Link the private data with the MTD structure */
- pasemi_nand_mtd->dev.parent = &ofdev->dev;
+ pasemi_nand_mtd->dev.parent = dev;
chip->IO_ADDR_R = of_iomap(np, 0);
chip->IO_ADDR_W = chip->IO_ADDR_R;
@@ -163,13 +162,13 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
}
if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
- printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
+ dev_err(dev, "Unable to register MTD device\n");
err = -ENODEV;
goto out_lpc;
}
- printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
- res.start, lpcctl);
+ dev_info(dev, "PA Semi NAND flash at %pR, control at I/O %x\n", &res,
+ lpcctl);
return 0;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions
2016-04-13 9:48 ` [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions Rafał Miłecki
@ 2016-04-13 11:54 ` Boris Brezillon
0 siblings, 0 replies; 9+ messages in thread
From: Boris Brezillon @ 2016-04-13 11:54 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Richard Weinberger, linux-mtd, Egor Martovetsky, Olof Johansson,
Joe Perches, David Woodhouse, Brian Norris,
open list:LINUX FOR POWERPC PA SEMI PWRFICIENT, open list
On Wed, 13 Apr 2016 11:48:05 +0200
Rafał Miłecki <zajec5@gmail.com> wrote:
> It also contains some minor related changes:
> 1) Don't warn if kzalloc fails as it dumps stack on its own
> 2) Use %pR format for displaying whole resource to avoid:
> warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘resource_size_t’
>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Applied with a slightly different commit message to avoid "Possible
unwrapped commit description" checkpatch warning.
Thanks,
Boris
> ---
> V3: Switch to dev_* instead of pr_*
> ---
> drivers/mtd/nand/pasemi_nand.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
> index 63fcb8c..5de7591 100644
> --- a/drivers/mtd/nand/pasemi_nand.c
> +++ b/drivers/mtd/nand/pasemi_nand.c
> @@ -92,8 +92,9 @@ int pasemi_device_ready(struct mtd_info *mtd)
>
> static int pasemi_nand_probe(struct platform_device *ofdev)
> {
> + struct device *dev = &ofdev->dev;
> struct pci_dev *pdev;
> - struct device_node *np = ofdev->dev.of_node;
> + struct device_node *np = dev->of_node;
> struct resource res;
> struct nand_chip *chip;
> int err = 0;
> @@ -107,13 +108,11 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> if (pasemi_nand_mtd)
> return -ENODEV;
>
> - pr_debug("pasemi_nand at %pR\n", &res);
> + dev_dbg(dev, "pasemi_nand at %pR\n", &res);
>
> /* Allocate memory for MTD device structure and private data */
> chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
> if (!chip) {
> - printk(KERN_WARNING
> - "Unable to allocate PASEMI NAND MTD device structure\n");
> err = -ENOMEM;
> goto out;
> }
> @@ -121,7 +120,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> pasemi_nand_mtd = nand_to_mtd(chip);
>
> /* Link the private data with the MTD structure */
> - pasemi_nand_mtd->dev.parent = &ofdev->dev;
> + pasemi_nand_mtd->dev.parent = dev;
>
> chip->IO_ADDR_R = of_iomap(np, 0);
> chip->IO_ADDR_W = chip->IO_ADDR_R;
> @@ -163,13 +162,13 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
> }
>
> if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
> - printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
> + dev_err(dev, "Unable to register MTD device\n");
> err = -ENODEV;
> goto out_lpc;
> }
>
> - printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
> - res.start, lpcctl);
> + dev_info(dev, "PA Semi NAND flash at %pR, control at I/O %x\n", &res,
> + lpcctl);
>
> return 0;
>
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-04-13 11:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 10:33 [PATCH] mtd: nand: pasemi: switch to pr_* functions Rafał Miłecki
2016-04-08 10:50 ` Joe Perches
2016-04-08 10:52 ` kbuild test robot
2016-04-08 11:13 ` [PATCH V2] " Rafał Miłecki
2016-04-08 16:49 ` Joe Perches
2016-04-09 9:50 ` Andy Shevchenko
2016-04-13 7:44 ` Boris Brezillon
2016-04-13 9:48 ` [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions Rafał Miłecki
2016-04-13 11:54 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).