linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pinctrl:for-next 87/90] drivers/pinctrl/mediatek/pinctrl-paris.c:149:42: error: 'val' undeclared
@ 2019-09-12 16:54 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-09-12 16:54 UTC (permalink / raw)
  To: Light Hsieh; +Cc: kbuild-all, linux-gpio, Linus Walleij

[-- Attachment #1: Type: text/plain, Size: 8902 bytes --]

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
head:   5a85bd8e3af3a78fd05d059835a52f5a7ee2cbc9
commit: 7ed13ac1a9685222f9fa163b89f7eae8ea4f7fa8 [87/90] pinctrl: mediatek: Refine mtk_pinconf_get() and mtk_pinconf_set()
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 7ed13ac1a9685222f9fa163b89f7eae8ea4f7fa8
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/pinctrl/mediatek/pinctrl-paris.c: In function 'mtk_pinconf_get':
>> drivers/pinctrl/mediatek/pinctrl-paris.c:149:42: error: 'val' undeclared (first use in this function)
      err = mtk_hw_get_value(hw, desc, reg, &val);
                                             ^~~
   drivers/pinctrl/mediatek/pinctrl-paris.c:149:42: note: each undeclared identifier is reported only once for each function it appears in

vim +/val +149 drivers/pinctrl/mediatek/pinctrl-paris.c

805250982bb5c5 Zhiyong Tao 2018-09-08   75  
805250982bb5c5 Zhiyong Tao 2018-09-08   76  static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
805250982bb5c5 Zhiyong Tao 2018-09-08   77  			   unsigned int pin, unsigned long *config)
805250982bb5c5 Zhiyong Tao 2018-09-08   78  {
805250982bb5c5 Zhiyong Tao 2018-09-08   79  	struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
805250982bb5c5 Zhiyong Tao 2018-09-08   80  	u32 param = pinconf_to_config_param(*config);
7ed13ac1a96852 Light Hsieh 2019-09-05   81  	int err, reg, ret = 1;
805250982bb5c5 Zhiyong Tao 2018-09-08   82  	const struct mtk_pin_desc *desc;
805250982bb5c5 Zhiyong Tao 2018-09-08   83  
805250982bb5c5 Zhiyong Tao 2018-09-08   84  	desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
805250982bb5c5 Zhiyong Tao 2018-09-08   85  
805250982bb5c5 Zhiyong Tao 2018-09-08   86  	switch (param) {
805250982bb5c5 Zhiyong Tao 2018-09-08   87  	case PIN_CONFIG_BIAS_DISABLE:
7ed13ac1a96852 Light Hsieh 2019-09-05   88  		if (hw->soc->bias_disable_get)
805250982bb5c5 Zhiyong Tao 2018-09-08   89  			err = hw->soc->bias_disable_get(hw, desc, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05   90  		else
7ed13ac1a96852 Light Hsieh 2019-09-05   91  			err = -ENOTSUPP;
805250982bb5c5 Zhiyong Tao 2018-09-08   92  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08   93  	case PIN_CONFIG_BIAS_PULL_UP:
7ed13ac1a96852 Light Hsieh 2019-09-05   94  		if (hw->soc->bias_get)
805250982bb5c5 Zhiyong Tao 2018-09-08   95  			err = hw->soc->bias_get(hw, desc, 1, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05   96  		else
7ed13ac1a96852 Light Hsieh 2019-09-05   97  			err = -ENOTSUPP;
805250982bb5c5 Zhiyong Tao 2018-09-08   98  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08   99  	case PIN_CONFIG_BIAS_PULL_DOWN:
7ed13ac1a96852 Light Hsieh 2019-09-05  100  		if (hw->soc->bias_get)
805250982bb5c5 Zhiyong Tao 2018-09-08  101  			err = hw->soc->bias_get(hw, desc, 0, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05  102  		else
7ed13ac1a96852 Light Hsieh 2019-09-05  103  			err = -ENOTSUPP;
805250982bb5c5 Zhiyong Tao 2018-09-08  104  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  105  	case PIN_CONFIG_SLEW_RATE:
7ed13ac1a96852 Light Hsieh 2019-09-05  106  		err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SR, &ret);
805250982bb5c5 Zhiyong Tao 2018-09-08  107  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  108  	case PIN_CONFIG_INPUT_ENABLE:
805250982bb5c5 Zhiyong Tao 2018-09-08  109  	case PIN_CONFIG_OUTPUT_ENABLE:
7ed13ac1a96852 Light Hsieh 2019-09-05  110  		err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05  111  		if (err)
7ed13ac1a96852 Light Hsieh 2019-09-05  112  			goto out;
7ed13ac1a96852 Light Hsieh 2019-09-05  113  		/*     CONFIG     Current direction return value
7ed13ac1a96852 Light Hsieh 2019-09-05  114  		 * -------------  ----------------- ----------------------
7ed13ac1a96852 Light Hsieh 2019-09-05  115  		 * OUTPUT_ENABLE       output       1 (= HW value)
7ed13ac1a96852 Light Hsieh 2019-09-05  116  		 *                     input        0 (= HW value)
7ed13ac1a96852 Light Hsieh 2019-09-05  117  		 * INPUT_ENABLE        output       0 (= reverse HW value)
7ed13ac1a96852 Light Hsieh 2019-09-05  118  		 *                     input        1 (= reverse HW value)
7ed13ac1a96852 Light Hsieh 2019-09-05  119  		 */
7ed13ac1a96852 Light Hsieh 2019-09-05  120  		if (param == PIN_CONFIG_INPUT_ENABLE)
7ed13ac1a96852 Light Hsieh 2019-09-05  121  			ret = !ret;
805250982bb5c5 Zhiyong Tao 2018-09-08  122  
805250982bb5c5 Zhiyong Tao 2018-09-08  123  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  124  	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
7ed13ac1a96852 Light Hsieh 2019-09-05  125  		err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
805250982bb5c5 Zhiyong Tao 2018-09-08  126  		if (err)
7ed13ac1a96852 Light Hsieh 2019-09-05  127  			goto out;
7ed13ac1a96852 Light Hsieh 2019-09-05  128  		/* return error when in output mode
7ed13ac1a96852 Light Hsieh 2019-09-05  129  		 * because schmitt trigger only work in input mode
7ed13ac1a96852 Light Hsieh 2019-09-05  130  		 */
7ed13ac1a96852 Light Hsieh 2019-09-05  131  		if (ret) {
7ed13ac1a96852 Light Hsieh 2019-09-05  132  			err = -EINVAL;
7ed13ac1a96852 Light Hsieh 2019-09-05  133  			goto out;
7ed13ac1a96852 Light Hsieh 2019-09-05  134  		}
805250982bb5c5 Zhiyong Tao 2018-09-08  135  
7ed13ac1a96852 Light Hsieh 2019-09-05  136  		err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SMT, &ret);
805250982bb5c5 Zhiyong Tao 2018-09-08  137  
805250982bb5c5 Zhiyong Tao 2018-09-08  138  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  139  	case PIN_CONFIG_DRIVE_STRENGTH:
7ed13ac1a96852 Light Hsieh 2019-09-05  140  		if (hw->soc->drive_get)
805250982bb5c5 Zhiyong Tao 2018-09-08  141  			err = hw->soc->drive_get(hw, desc, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05  142  		else
805250982bb5c5 Zhiyong Tao 2018-09-08  143  			err = -ENOTSUPP;
805250982bb5c5 Zhiyong Tao 2018-09-08  144  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  145  	case MTK_PIN_CONFIG_TDSEL:
805250982bb5c5 Zhiyong Tao 2018-09-08  146  	case MTK_PIN_CONFIG_RDSEL:
805250982bb5c5 Zhiyong Tao 2018-09-08  147  		reg = (param == MTK_PIN_CONFIG_TDSEL) ?
805250982bb5c5 Zhiyong Tao 2018-09-08  148  		       PINCTRL_PIN_REG_TDSEL : PINCTRL_PIN_REG_RDSEL;
805250982bb5c5 Zhiyong Tao 2018-09-08 @149  		err = mtk_hw_get_value(hw, desc, reg, &val);
805250982bb5c5 Zhiyong Tao 2018-09-08  150  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  151  	case MTK_PIN_CONFIG_PU_ADV:
805250982bb5c5 Zhiyong Tao 2018-09-08  152  	case MTK_PIN_CONFIG_PD_ADV:
805250982bb5c5 Zhiyong Tao 2018-09-08  153  		if (hw->soc->adv_pull_get) {
805250982bb5c5 Zhiyong Tao 2018-09-08  154  			bool pullup;
805250982bb5c5 Zhiyong Tao 2018-09-08  155  
805250982bb5c5 Zhiyong Tao 2018-09-08  156  			pullup = param == MTK_PIN_CONFIG_PU_ADV;
805250982bb5c5 Zhiyong Tao 2018-09-08  157  			err = hw->soc->adv_pull_get(hw, desc, pullup, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05  158  		} else
7ed13ac1a96852 Light Hsieh 2019-09-05  159  			err = -ENOTSUPP;
805250982bb5c5 Zhiyong Tao 2018-09-08  160  		break;
5e73de3413c5e0 Zhiyong Tao 2019-04-01  161  	case MTK_PIN_CONFIG_DRV_ADV:
7ed13ac1a96852 Light Hsieh 2019-09-05  162  		if (hw->soc->adv_drive_get)
5e73de3413c5e0 Zhiyong Tao 2019-04-01  163  			err = hw->soc->adv_drive_get(hw, desc, &ret);
7ed13ac1a96852 Light Hsieh 2019-09-05  164  		else
7ed13ac1a96852 Light Hsieh 2019-09-05  165  			err = -ENOTSUPP;
5e73de3413c5e0 Zhiyong Tao 2019-04-01  166  		break;
805250982bb5c5 Zhiyong Tao 2018-09-08  167  	default:
7ed13ac1a96852 Light Hsieh 2019-09-05  168  		err = -ENOTSUPP;
805250982bb5c5 Zhiyong Tao 2018-09-08  169  	}
805250982bb5c5 Zhiyong Tao 2018-09-08  170  
7ed13ac1a96852 Light Hsieh 2019-09-05  171  out:
7ed13ac1a96852 Light Hsieh 2019-09-05  172  	if (!err)
805250982bb5c5 Zhiyong Tao 2018-09-08  173  		*config = pinconf_to_config_packed(param, ret);
805250982bb5c5 Zhiyong Tao 2018-09-08  174  
7ed13ac1a96852 Light Hsieh 2019-09-05  175  	return err;
805250982bb5c5 Zhiyong Tao 2018-09-08  176  }
805250982bb5c5 Zhiyong Tao 2018-09-08  177  

:::::: The code at line 149 was first introduced by commit
:::::: 805250982bb5c5ce4a6e52e1d87204c5feea0dd1 pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings

:::::: TO: Zhiyong Tao <zhiyong.tao@mediatek.com>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51811 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-12 16:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 16:54 [pinctrl:for-next 87/90] drivers/pinctrl/mediatek/pinctrl-paris.c:149:42: error: 'val' undeclared kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).