drivers/clk/bcm/clk-bcm2835.c:2144:1-13: WARNING: Use devm_platform_ioremap_resource for cprman -> regs (fwd)

From: Julia Lawall
Date: Thu Aug 08 2019 - 08:54:29 EST




---------- Forwarded message ----------
Date: Thu, 8 Aug 2019 20:52:32 +0800
From: kbuild test robot <lkp@xxxxxxxxx>
To: kbuild@xxxxxx
Cc: Julia Lawall <julia.lawall@xxxxxxx>
Subject: drivers/clk/bcm/clk-bcm2835.c:2144:1-13: WARNING: Use
devm_platform_ioremap_resource for cprman -> regs

CC: kbuild-all@xxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
TO: Florian Fainelli <f.fainelli@xxxxxxxxx>
CC: Stephen Boyd <sboyd@xxxxxxxxxx>
CC: Eric Anholt <eric@xxxxxxxxxx>

tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ecb095bff5d4b8711a81968625b3b4a235d3e477
commit: 5d59f12a19e6cb96a1a72fac2b0d73ab8435b167 clk: bcm: Make BCM2835 clock drivers selectable
date: 9 weeks ago
:::::: branch date: 15 hours ago
:::::: commit date: 9 weeks 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/clk/bcm/clk-bcm2835.c:2144:1-13: WARNING: Use devm_platform_ioremap_resource for cprman -> regs

git remote add linus https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 5d59f12a19e6cb96a1a72fac2b0d73ab8435b167
vim +2144 drivers/clk/bcm/clk-bcm2835.c

9e400c5cc5c105 Eric Anholt 2016-06-01 2123
41691b8862e2a3 Eric Anholt 2015-10-08 2124 static int bcm2835_clk_probe(struct platform_device *pdev)
41691b8862e2a3 Eric Anholt 2015-10-08 2125 {
41691b8862e2a3 Eric Anholt 2015-10-08 2126 struct device *dev = &pdev->dev;
b19f009d451060 Stephen Boyd 2016-06-01 2127 struct clk_hw **hws;
41691b8862e2a3 Eric Anholt 2015-10-08 2128 struct bcm2835_cprman *cprman;
41691b8862e2a3 Eric Anholt 2015-10-08 2129 struct resource *res;
56eb3a2ed97269 Martin Sperl 2016-02-29 2130 const struct bcm2835_clk_desc *desc;
56eb3a2ed97269 Martin Sperl 2016-02-29 2131 const size_t asize = ARRAY_SIZE(clk_desc_array);
56eb3a2ed97269 Martin Sperl 2016-02-29 2132 size_t i;
9e400c5cc5c105 Eric Anholt 2016-06-01 2133 int ret;
41691b8862e2a3 Eric Anholt 2015-10-08 2134
0ed2dd03b94b7b Kees Cook 2018-05-08 2135 cprman = devm_kzalloc(dev,
0ed2dd03b94b7b Kees Cook 2018-05-08 2136 struct_size(cprman, onecell.hws, asize),
56eb3a2ed97269 Martin Sperl 2016-02-29 2137 GFP_KERNEL);
41691b8862e2a3 Eric Anholt 2015-10-08 2138 if (!cprman)
41691b8862e2a3 Eric Anholt 2015-10-08 2139 return -ENOMEM;
41691b8862e2a3 Eric Anholt 2015-10-08 2140
41691b8862e2a3 Eric Anholt 2015-10-08 2141 spin_lock_init(&cprman->regs_lock);
41691b8862e2a3 Eric Anholt 2015-10-08 2142 cprman->dev = dev;
41691b8862e2a3 Eric Anholt 2015-10-08 2143 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
41691b8862e2a3 Eric Anholt 2015-10-08 @2144 cprman->regs = devm_ioremap_resource(dev, res);
41691b8862e2a3 Eric Anholt 2015-10-08 2145 if (IS_ERR(cprman->regs))
41691b8862e2a3 Eric Anholt 2015-10-08 2146 return PTR_ERR(cprman->regs);
41691b8862e2a3 Eric Anholt 2015-10-08 2147
8a39e9fa578229 Eric Anholt 2017-01-18 2148 memcpy(cprman->real_parent_names, cprman_parent_names,
8a39e9fa578229 Eric Anholt 2017-01-18 2149 sizeof(cprman_parent_names));
8a39e9fa578229 Eric Anholt 2017-01-18 2150 of_clk_parent_fill(dev->of_node, cprman->real_parent_names,
8a39e9fa578229 Eric Anholt 2017-01-18 2151 ARRAY_SIZE(cprman_parent_names));
8a39e9fa578229 Eric Anholt 2017-01-18 2152
8a39e9fa578229 Eric Anholt 2017-01-18 2153 /*
8a39e9fa578229 Eric Anholt 2017-01-18 2154 * Make sure the external oscillator has been registered.
8a39e9fa578229 Eric Anholt 2017-01-18 2155 *
8a39e9fa578229 Eric Anholt 2017-01-18 2156 * The other (DSI) clocks are not present on older device
8a39e9fa578229 Eric Anholt 2017-01-18 2157 * trees, which we still need to support for backwards
8a39e9fa578229 Eric Anholt 2017-01-18 2158 * compatibility.
8a39e9fa578229 Eric Anholt 2017-01-18 2159 */
8a39e9fa578229 Eric Anholt 2017-01-18 2160 if (!cprman->real_parent_names[0])
41691b8862e2a3 Eric Anholt 2015-10-08 2161 return -ENODEV;
41691b8862e2a3 Eric Anholt 2015-10-08 2162
41691b8862e2a3 Eric Anholt 2015-10-08 2163 platform_set_drvdata(pdev, cprman);
41691b8862e2a3 Eric Anholt 2015-10-08 2164
b19f009d451060 Stephen Boyd 2016-06-01 2165 cprman->onecell.num = asize;
b19f009d451060 Stephen Boyd 2016-06-01 2166 hws = cprman->onecell.hws;
41691b8862e2a3 Eric Anholt 2015-10-08 2167
56eb3a2ed97269 Martin Sperl 2016-02-29 2168 for (i = 0; i < asize; i++) {
56eb3a2ed97269 Martin Sperl 2016-02-29 2169 desc = &clk_desc_array[i];
56eb3a2ed97269 Martin Sperl 2016-02-29 2170 if (desc->clk_register && desc->data)
b19f009d451060 Stephen Boyd 2016-06-01 2171 hws[i] = desc->clk_register(cprman, desc->data);
56eb3a2ed97269 Martin Sperl 2016-02-29 2172 }
cfbab8fbab9c33 Remi Pommarel 2015-12-06 2173
b19f009d451060 Stephen Boyd 2016-06-01 2174 ret = bcm2835_mark_sdc_parent_critical(hws[BCM2835_CLOCK_SDRAM]->clk);
9e400c5cc5c105 Eric Anholt 2016-06-01 2175 if (ret)
9e400c5cc5c105 Eric Anholt 2016-06-01 2176 return ret;
9e400c5cc5c105 Eric Anholt 2016-06-01 2177
b19f009d451060 Stephen Boyd 2016-06-01 2178 return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
41691b8862e2a3 Eric Anholt 2015-10-08 2179 &cprman->onecell);
41691b8862e2a3 Eric Anholt 2015-10-08 2180 }
41691b8862e2a3 Eric Anholt 2015-10-08 2181

:::::: The code at line 2144 was first introduced by commit
:::::: 41691b8862e2a32080306f17a723efc4b6ca86ab clk: bcm2835: Add support for programming the audio domain clocks

:::::: TO: Eric Anholt <eric@xxxxxxxxxx>
:::::: CC: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation