tree:
https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: c2a69d794dc6686bf77f7565ae51d4f7a4e8cd99
commit: 4c58ea4fc47b843a848d2a4456dc4ec9d52d3cff [19/24] DNI: Regulator: Debug
config: microblaze-randconfig-r005-20201016 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/...
git remote add rcar
https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git fetch --no-tags rcar gmsl/dev
git checkout 4c58ea4fc47b843a848d2a4456dc4ec9d52d3cff
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/regulator/gpio-regulator.c:24:
drivers/regulator/gpio-regulator.c: In function 'gpio_regulator_probe':
> drivers/regulator/gpio-regulator.c:252:17: warning: format
'%d' expects argument of type 'int', but argument 3 has type 'long
int' [-Wformat=]
252 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG
%d\n", PTR_ERR(config));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/regulator/gpio-regulator.c:252:4: note: in expansion of macro
'dev_err'
252 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %d\n",
PTR_ERR(config));
| ^~~~~~~
drivers/regulator/gpio-regulator.c:252:48: note: format string is defined here
252 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %d\n",
PTR_ERR(config));
| ~^
| |
| int
| %ld
vim +252 drivers/regulator/gpio-regulator.c
230
231 static int gpio_regulator_probe(struct platform_device *pdev)
232 {
233 struct device *dev = &pdev->dev;
234 struct gpio_regulator_config *config = dev_get_platdata(dev);
235 struct device_node *np = dev->of_node;
236 struct gpio_regulator_data *drvdata;
237 struct regulator_config cfg = { };
238 struct regulator_dev *rdev;
239 enum gpiod_flags gflags;
240 int ptr, ret, state, i;
241
242 drvdata = devm_kzalloc(dev, sizeof(struct gpio_regulator_data),
243 GFP_KERNEL);
244 if (drvdata == NULL)
245 return -ENOMEM;
246
247 if (np) {
248 config = of_get_gpio_regulator_config(dev, np,
249 &drvdata->desc);
250
251 if (IS_ERR(config)) {
252 dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %d\n",
PTR_ERR(config));
253 return PTR_ERR(config);
254 }
255 }
256
257 dev_err(dev, "Probing GPIO Regulator\n");
258
259 drvdata->desc.name = devm_kstrdup(dev, config->supply_name, GFP_KERNEL);
260 if (drvdata->desc.name == NULL) {
261 dev_err(dev, "Failed to allocate supply name\n");
262 return -ENOMEM;
263 }
264
265 drvdata->gpiods = devm_kzalloc(dev, sizeof(struct gpio_desc *),
266 GFP_KERNEL);
267 if (!drvdata->gpiods)
268 return -ENOMEM;
269
270 for (i = 0; i < config->ngpios; i++) {
271 drvdata->gpiods[i] = devm_gpiod_get_index(dev,
272 NULL,
273 i,
274 config->gflags[i]);
275 if (IS_ERR(drvdata->gpiods[i]))
276 return PTR_ERR(drvdata->gpiods[i]);
277 /* This is good to know */
278 gpiod_set_consumer_name(drvdata->gpiods[i], drvdata->desc.name);
279 }
280 drvdata->nr_gpios = config->ngpios;
281
282 drvdata->states = devm_kmemdup(dev,
283 config->states,
284 config->nr_states *
285 sizeof(struct gpio_regulator_state),
286 GFP_KERNEL);
287 if (drvdata->states == NULL) {
288 dev_err(dev, "Failed to allocate state data\n");
289 return -ENOMEM;
290 }
291 drvdata->nr_states = config->nr_states;
292
293 drvdata->desc.owner = THIS_MODULE;
294 drvdata->desc.enable_time = config->startup_delay;
295
296 /* handle regulator type*/
297 switch (config->type) {
298 case REGULATOR_VOLTAGE:
299 drvdata->desc.type = REGULATOR_VOLTAGE;
300 drvdata->desc.ops = &gpio_regulator_voltage_ops;
301 drvdata->desc.n_voltages = config->nr_states;
302 break;
303 case REGULATOR_CURRENT:
304 drvdata->desc.type = REGULATOR_CURRENT;
305 drvdata->desc.ops = &gpio_regulator_current_ops;
306 break;
307 default:
308 dev_err(dev, "No regulator type set\n");
309 return -EINVAL;
310 }
311
312 /* build initial state from gpio init data. */
313 state = 0;
314 for (ptr = 0; ptr < drvdata->nr_gpios; ptr++) {
315 if (config->gflags[ptr] == GPIOD_OUT_HIGH)
316 state |= (1 << ptr);
317 }
318 drvdata->state = state;
319
320 cfg.dev = dev;
321 cfg.init_data = config->init_data;
322 cfg.driver_data = drvdata;
323 cfg.of_node = np;
324
325 /*
326 * The signal will be inverted by the GPIO core if flagged so in the
327 * descriptor.
328 */
329 if (config->enabled_at_boot)
330 gflags = GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
331 else
332 gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
333
334 cfg.ena_gpiod = gpiod_get_optional(dev, "enable", gflags);
335 if (IS_ERR(cfg.ena_gpiod))
336 return PTR_ERR(cfg.ena_gpiod);
337
338 rdev = devm_regulator_register(dev, &drvdata->desc, &cfg);
339 if (IS_ERR(rdev)) {
340 ret = PTR_ERR(rdev);
341 dev_err(dev, "Failed to register regulator: %d\n", ret);
342 return ret;
343 }
344
345 platform_set_drvdata(pdev, drvdata);
346
347 return 0;
348 }
349
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org