sound/pci/hda/cirrus_scodec_test.c:40: undefined reference to `gpiochip_get_data'
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 926f75c8a5ab70567eb4c2d82fbc96963313e564 commit: 2144833e7b41459fa2d52bb0676f0ab4920cf32c [5683/6619] ALSA: hda: cirrus_scodec: Add KUnit test config: x86_64-randconfig-016-20230822 (https://download.01.org/0day-ci/archive/20230920/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230920/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
ld: vmlinux.o: in function `cirrus_scodec_test_gpio_get':
>> sound/pci/hda/cirrus_scodec_test.c:40: undefined reference to `gpiochip_get_data' ld: vmlinux.o: in function `cirrus_scodec_test_gpio_probe': >> sound/pci/hda/cirrus_scodec_test.c:94: undefined reference to `gpiochip_generic_request' >> ld: sound/pci/hda/cirrus_scodec_test.c:94: undefined reference to `gpiochip_generic_free' >> ld: sound/pci/hda/cirrus_scodec_test.c:95: undefined reference to `devm_gpiochip_add_data_with_key'
vim +40 sound/pci/hda/cirrus_scodec_test.c
37
38 static int cirrus_scodec_test_gpio_get(struct gpio_chip *chip, unsigned int offset)
39 {
> 40 struct cirrus_scodec_test_gpio *gpio_priv = gpiochip_get_data(chip);
41
42 return !!(gpio_priv->pin_state & BIT(offset));
43 }
44
45 static int cirrus_scodec_test_gpio_direction_out(struct gpio_chip *chip,
46 unsigned int offset, int value)
47 {
48 return -EOPNOTSUPP;
49 }
50
51 static void cirrus_scodec_test_gpio_set(struct gpio_chip *chip, unsigned int offset,
52 int value)
53 {
54 }
55
56 static int cirrus_scodec_test_gpio_set_config(struct gpio_chip *gc,
57 unsigned int offset,
58 unsigned long config)
59 {
60 switch (pinconf_to_config_param(config)) {
61 case PIN_CONFIG_OUTPUT:
62 case PIN_CONFIG_OUTPUT_ENABLE:
63 return -EOPNOTSUPP;
64 default:
65 return 0;
66 }
67 }
68
69 static const struct gpio_chip cirrus_scodec_test_gpio_chip = {
70 .label = "cirrus_scodec_test_gpio",
71 .owner = THIS_MODULE,
72 .request = gpiochip_generic_request,
73 .free = gpiochip_generic_free,
74 .get_direction = cirrus_scodec_test_gpio_get_direction,
75 .direction_input = cirrus_scodec_test_gpio_direction_in,
76 .get = cirrus_scodec_test_gpio_get,
77 .direction_output = cirrus_scodec_test_gpio_direction_out,
78 .set = cirrus_scodec_test_gpio_set,
79 .set_config = cirrus_scodec_test_gpio_set_config,
80 .base = -1,
81 .ngpio = 32,
82 };
83
84 static int cirrus_scodec_test_gpio_probe(struct platform_device *pdev)
85 {
86 struct cirrus_scodec_test_gpio *gpio_priv;
87 int ret;
88
89 gpio_priv = devm_kzalloc(&pdev->dev, sizeof(*gpio_priv), GFP_KERNEL);
90 if (!gpio_priv)
91 return -ENOMEM;
92
93 /* GPIO core modifies our struct gpio_chip so use a copy */
> 94 gpio_priv->chip = cirrus_scodec_test_gpio_chip;
> 95 ret = devm_gpiochip_add_data(&pdev->dev, &gpio_priv->chip, gpio_priv);
96 if (ret)
97 return dev_err_probe(&pdev->dev, ret, "Failed to add gpiochip\n");
98
99 dev_set_drvdata(&pdev->dev, gpio_priv); 100
101 return 0;
102 }
103
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki