* [rcar:gmsl/dev 19/24] drivers/regulator/gpio-regulator.c:252:54: warning: format specifies type 'int' but the argument has type 'long'
@ 2020-10-16 17:27 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-10-16 17:27 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 6199 bytes --]
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: x86_64-randconfig-a004-20201016 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5fbab4025eb57b12f2842ab188ff07a110708e1d)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?id=4c58ea4fc47b843a848d2a4456dc4ec9d52d3cff
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=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/regulator/gpio-regulator.c:252:54: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %d\n", PTR_ERR(config));
~~ ^~~~~~~~~~~~~~~
%ld
include/linux/dev_printk.h:104:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
1 warning generated.
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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34555 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-16 17:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 17:27 [rcar:gmsl/dev 19/24] drivers/regulator/gpio-regulator.c:252:54: warning: format specifies type 'int' but the argument has type 'long' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.