drivers/mtd/nand/raw/ingenic/ingenic_ecc.c:142:1-10: WARNING: Use devm_platform_ioremap_resource for ecc -> base
From: Julia Lawall
Date: Mon Jul 22 2019 - 20:34:04 EST
Hello,
The calls to platform_get_resource and devm_ioremap_resource can be
merged.
julia
---------- Forwarded message ----------
Date: Tue, 23 Jul 2019 06:07:33 +0800
From: kbuild test robot <lkp@xxxxxxxxx>
To: kbuild@xxxxxx
Cc: Julia Lawall <julia.lawall@xxxxxxx>
Subject: drivers/mtd/nand/raw/ingenic/ingenic_ecc.c:142:1-10: WARNING: Use
devm_platform_ioremap_resource for ecc -> base
CC: kbuild-all@xxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
TO: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7b5cf701ea9c395c792e2a7e3b7caf4c68b87721
commit: 72c5af00272339af6bbed6fe7275cd731f57be2d mtd: rawnand: Clarify Kconfig entry MTD_NAND
date: 3 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 3 months ago
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Reported-by: Julia Lawall <julia.lawall@xxxxxxx>
>> drivers/mtd/nand/raw/ingenic/ingenic_ecc.c:142:1-10: WARNING: Use devm_platform_ioremap_resource for ecc -> base
git remote add linus https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 72c5af00272339af6bbed6fe7275cd731f57be2d
vim +142 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
15de8c6efd0effe Paul Cercueil 2019-03-19 126
15de8c6efd0effe Paul Cercueil 2019-03-19 127 int ingenic_ecc_probe(struct platform_device *pdev)
15de8c6efd0effe Paul Cercueil 2019-03-19 128 {
15de8c6efd0effe Paul Cercueil 2019-03-19 129 struct device *dev = &pdev->dev;
15de8c6efd0effe Paul Cercueil 2019-03-19 130 struct ingenic_ecc *ecc;
15de8c6efd0effe Paul Cercueil 2019-03-19 131 struct resource *res;
15de8c6efd0effe Paul Cercueil 2019-03-19 132
15de8c6efd0effe Paul Cercueil 2019-03-19 133 ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL);
15de8c6efd0effe Paul Cercueil 2019-03-19 134 if (!ecc)
15de8c6efd0effe Paul Cercueil 2019-03-19 135 return -ENOMEM;
15de8c6efd0effe Paul Cercueil 2019-03-19 136
15de8c6efd0effe Paul Cercueil 2019-03-19 137 ecc->ops = device_get_match_data(dev);
15de8c6efd0effe Paul Cercueil 2019-03-19 138 if (!ecc->ops)
15de8c6efd0effe Paul Cercueil 2019-03-19 139 return -EINVAL;
15de8c6efd0effe Paul Cercueil 2019-03-19 140
15de8c6efd0effe Paul Cercueil 2019-03-19 141 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
15de8c6efd0effe Paul Cercueil 2019-03-19 @142 ecc->base = devm_ioremap_resource(dev, res);
15de8c6efd0effe Paul Cercueil 2019-03-19 143 if (IS_ERR(ecc->base))
15de8c6efd0effe Paul Cercueil 2019-03-19 144 return PTR_ERR(ecc->base);
15de8c6efd0effe Paul Cercueil 2019-03-19 145
15de8c6efd0effe Paul Cercueil 2019-03-19 146 ecc->ops->disable(ecc);
15de8c6efd0effe Paul Cercueil 2019-03-19 147
15de8c6efd0effe Paul Cercueil 2019-03-19 148 ecc->clk = devm_clk_get(dev, NULL);
15de8c6efd0effe Paul Cercueil 2019-03-19 149 if (IS_ERR(ecc->clk)) {
15de8c6efd0effe Paul Cercueil 2019-03-19 150 dev_err(dev, "failed to get clock: %ld\n", PTR_ERR(ecc->clk));
15de8c6efd0effe Paul Cercueil 2019-03-19 151 return PTR_ERR(ecc->clk);
15de8c6efd0effe Paul Cercueil 2019-03-19 152 }
15de8c6efd0effe Paul Cercueil 2019-03-19 153
15de8c6efd0effe Paul Cercueil 2019-03-19 154 mutex_init(&ecc->lock);
15de8c6efd0effe Paul Cercueil 2019-03-19 155
15de8c6efd0effe Paul Cercueil 2019-03-19 156 ecc->dev = dev;
15de8c6efd0effe Paul Cercueil 2019-03-19 157 platform_set_drvdata(pdev, ecc);
15de8c6efd0effe Paul Cercueil 2019-03-19 158
15de8c6efd0effe Paul Cercueil 2019-03-19 159 return 0;
15de8c6efd0effe Paul Cercueil 2019-03-19 160 }
15de8c6efd0effe Paul Cercueil 2019-03-19 161 EXPORT_SYMBOL(ingenic_ecc_probe);
15de8c6efd0effe Paul Cercueil 2019-03-19 162
15de8c6efd0effe Paul Cercueil 2019-03-19 163 MODULE_LICENSE("GPL v2");
:::::: The code at line 142 was first introduced by commit
:::::: 15de8c6efd0effef3a5226bd5ab7f101c9f4948f mtd: rawnand: ingenic: Separate top-level and SoC specific code
:::::: TO: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
:::::: CC: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation