Re: [PATCH 2/2] pinctrl: Introduce TI IOdelay configuration driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nishanth,

[auto build test ERROR on pinctrl/for-next]
[also build test ERROR on v4.10-rc1 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Tony-Lindgren/Add-TI-iodelay-driver-using-pinctrl-cells/20161231-024542
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/pinctrl/ti/pinctrl-ti-iodelay.c: In function 'ti_iodelay_get_pingroup':
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c:383:6: error: implicit declaration of function 'pinctrl_generic_get_group' [-Werror=implicit-function-declaration]
     g = pinctrl_generic_get_group(iod->pctl, selector);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c:383:4: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     g = pinctrl_generic_get_group(iod->pctl, selector);
       ^
>> drivers/pinctrl/ti/pinctrl-ti-iodelay.c:391:10: error: dereferencing pointer to incomplete type 'struct group_desc'
     return g->data;
             ^~
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c: In function 'ti_iodelay_dt_node_to_map':
>> drivers/pinctrl/ti/pinctrl-ti-iodelay.c:562:10: error: implicit declaration of function 'pinctrl_generic_add_group' [-Werror=implicit-function-declaration]
     error = pinctrl_generic_add_group(iod->pctl, np->name, pins, i, g);
             ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c: At top level:
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c:729:22: error: 'pinctrl_generic_get_group_count' undeclared here (not in a function)
     .get_groups_count = pinctrl_generic_get_group_count,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/ti/pinctrl-ti-iodelay.c:730:20: error: 'pinctrl_generic_get_group_name' undeclared here (not in a function)
     .get_group_name = pinctrl_generic_get_group_name,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/ti/pinctrl-ti-iodelay.c:731:20: error: 'pinctrl_generic_get_group_pins' undeclared here (not in a function)
     .get_group_pins = pinctrl_generic_get_group_pins,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c: In function 'ti_iodelay_get_pingroup':
   drivers/pinctrl/ti/pinctrl-ti-iodelay.c:392:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   cc1: some warnings being treated as errors

vim +391 drivers/pinctrl/ti/pinctrl-ti-iodelay.c

   377	 */
   378	static struct ti_iodelay_pingroup *
   379	ti_iodelay_get_pingroup(struct ti_iodelay_device *iod, unsigned int selector)
   380	{
   381		struct group_desc *g;
   382	
 > 383		g = pinctrl_generic_get_group(iod->pctl, selector);
   384		if (!g) {
   385			dev_err(iod->dev, "%s could not find pingroup %i\n", __func__,
   386				selector);
   387	
   388			return NULL;
   389		}
   390	
 > 391		return g->data;
   392	}
   393	
   394	/**
   395	 * ti_iodelay_pin_to_offset() - get pin register offset based on the pin index
   396	 * @iod: iodelay driver instance
   397	 * @selector: Pin index
   398	 */
   399	static unsigned int ti_iodelay_pin_to_offset(struct ti_iodelay_device *iod,
   400						     unsigned int selector)
   401	{
   402		const struct ti_iodelay_reg_data *r = iod->reg_data;
   403		unsigned int offset;
   404	
   405		offset = selector * r->regmap_config->reg_stride;
   406		offset *= r->reg_nr_per_pin;
   407		offset += r->reg_start_offset;
   408	
   409		return offset;
   410	}
   411	
   412	/**
   413	 * ti_iodelay_offset_to_pin() - get a pin index based on the register offset
   414	 * @iod: iodelay driver instance
   415	 * @offset: register offset from the base
   416	 */
   417	static int ti_iodelay_offset_to_pin(struct ti_iodelay_device *iod,
   418					    unsigned int offset)
   419	{
   420		const struct ti_iodelay_reg_data *r = iod->reg_data;
   421		unsigned int index;
   422	
   423		if (offset > r->regmap_config->max_register) {
   424			dev_err(iod->dev, "mux offset out of range: 0x%x (0x%x)\n",
   425				offset, r->regmap_config->max_register);
   426			return -EINVAL;
   427		}
   428	
   429		index = (offset - r->reg_start_offset) / r->regmap_config->reg_stride;
   430		index /= r->reg_nr_per_pin;
   431	
   432		return index;
   433	}
   434	
   435	/**
   436	 *
   437	 * @pctldev: Pin controller driver
   438	 * @np: Device node
   439	 * @pinctrl_spec: Parsed arguments from device tree
   440	 * @pins: Array of pins in the pin group
   441	 * @pin_index: Pin index in the pin array
   442	 * @data: Pin controller driver specific data
   443	 *
   444	 */
   445	static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
   446					    struct device_node *np,
   447					    const struct of_phandle_args *pinctrl_spec,
   448					    int *pins, int pin_index, void *data)
   449	{
   450		struct ti_iodelay_device *iod;
   451		struct ti_iodelay_cfg *cfg = data;
   452		const struct ti_iodelay_reg_data *r;
   453		struct pinctrl_pin_desc *pd;
   454		int pin;
   455	
   456		iod = pinctrl_dev_get_drvdata(pctldev);
   457		if (!iod)
   458			return -EINVAL;
   459	
   460		r = iod->reg_data;
   461	
   462		if (pinctrl_spec->args_count < r->reg_nr_per_pin) {
   463			dev_err(iod->dev, "invalid args_count for spec: %i\n",
   464				pinctrl_spec->args_count);
   465	
   466			return -EINVAL;
   467		}
   468	
   469		/* Index plus two value cells */
   470		cfg[pin_index].offset = pinctrl_spec->args[0];
   471		cfg[pin_index].a_delay = pinctrl_spec->args[1] & 0xffff;
   472		cfg[pin_index].g_delay = pinctrl_spec->args[2] & 0xffff;
   473	
   474		pin = ti_iodelay_offset_to_pin(iod, cfg[pin_index].offset);
   475		if (pin < 0) {
   476			dev_err(iod->dev, "could not add functions for %s %ux\n",
   477				np->name, cfg[pin_index].offset);
   478			return -ENODEV;
   479		}
   480		pins[pin_index] = pin;
   481	
   482		pd = &iod->pa[pin];
   483		pd->drv_data = &cfg[pin_index];
   484	
   485		dev_dbg(iod->dev, "%s offset=%x a_delay = %d g_delay = %d\n",
   486			np->name, cfg[pin_index].offset, cfg[pin_index].a_delay,
   487			cfg[pin_index].g_delay);
   488	
   489		return 0;
   490	}
   491	
   492	/**
   493	 * ti_iodelay_dt_node_to_map() - Map a device tree node to appropriate group
   494	 * @pctldev: pinctrl device representing IODelay device
   495	 * @np: Node Pointer (device tree)
   496	 * @map: Pinctrl Map returned back to pinctrl framework
   497	 * @num_maps: Number of maps (1)
   498	 *
   499	 * Maps the device tree description into a group of configuration parameters
   500	 * for iodelay block entry.
   501	 *
   502	 * Return: 0 in case of success, else appropriate error value
   503	 */
   504	static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
   505					     struct device_node *np,
   506					     struct pinctrl_map **map,
   507					     unsigned int *num_maps)
   508	{
   509		struct ti_iodelay_device *iod;
   510		struct ti_iodelay_cfg *cfg;
   511		struct ti_iodelay_pingroup *g;
   512		const char *name = "pinctrl-pin-array";
   513		int rows, *pins, error = -EINVAL, i;
   514	
   515		iod = pinctrl_dev_get_drvdata(pctldev);
   516		if (!iod)
   517			return -EINVAL;
   518	
   519		rows = pinctrl_count_index_with_args(np, name);
   520		if (rows == -EINVAL)
   521			return rows;
   522	
   523		*map = devm_kzalloc(iod->dev, sizeof(**map), GFP_KERNEL);
   524		if (!*map)
   525			return -ENOMEM;
   526		*num_maps = 0;
   527	
   528		g = devm_kzalloc(iod->dev, sizeof(*g), GFP_KERNEL);
   529		if (!g) {
   530			error = -ENOMEM;
   531			goto free_map;
   532		}
   533	
   534		pins = devm_kzalloc(iod->dev, sizeof(*pins) * rows, GFP_KERNEL);
   535		if (!pins)
   536			goto free_group;
   537	
   538		cfg = devm_kzalloc(iod->dev, sizeof(*cfg) * rows, GFP_KERNEL);
   539		if (!cfg) {
   540			error = -ENOMEM;
   541			goto free_pins;
   542		}
   543	
   544		for (i = 0; i < rows; i++) {
   545			struct of_phandle_args pinctrl_spec;
   546	
   547			error = pinctrl_parse_index_with_args(np, name, i,
   548							      &pinctrl_spec);
   549			if (error)
   550				goto free_data;
   551	
   552			error = ti_iodelay_node_iterator(pctldev, np, &pinctrl_spec,
   553							 pins, i, cfg);
   554			if (error)
   555				goto free_data;
   556		}
   557	
   558		g->cfg = cfg;
   559		g->ncfg = i;
   560		g->config = PIN_CONFIG_END;
   561	
 > 562		error = pinctrl_generic_add_group(iod->pctl, np->name, pins, i, g);
   563		if (error < 0)
   564			goto free_data;
   565	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux