* [brgl:gpio/for-next 5/12] drivers/gpio/gpio-altera.c:224:21: error: 'irq' undeclared; did you mean 'girq'?
@ 2026-09-03 12:15 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-03 12:15 UTC (permalink / raw)
To: bui duc phuc; +Cc: oe-kbuild-all, linux-gpio, Bartosz Golaszewski
tree: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
head: a2cfc48fee416f0ea78e7dc38acbf2ce072574cc
commit: 6e6e585b603e4f679c2a33c8f0954ec88b52fd7a [5/12] gpio: altera: Handle errors from optional IRQ lookup
config: openrisc-randconfig-r072-20260902 (https://download.01.org/0day-ci/archive/20260903/202609032003.JKU2nkvu-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 14.3.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260903/202609032003.JKU2nkvu-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609032003.JKU2nkvu-lkp@intel.com/
Note: the brgl/gpio/for-next HEAD a2cfc48fee416f0ea78e7dc38acbf2ce072574cc builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
drivers/gpio/gpio-altera.c: In function 'altera_gpio_probe':
>> drivers/gpio/gpio-altera.c:224:21: error: 'irq' undeclared (first use in this function); did you mean 'girq'?
224 | if (irq != -ENXIO)
| ^~~
| girq
drivers/gpio/gpio-altera.c:224:21: note: each undeclared identifier is reported only once for each function it appears in
vim +224 drivers/gpio/gpio-altera.c
165
166 static int altera_gpio_probe(struct platform_device *pdev)
167 {
168 struct gpio_generic_chip_config config;
169 struct device *dev = &pdev->dev;
170 int reg, ret;
171 struct altera_gpio_chip *altera_gc;
172 struct gpio_generic_chip *chip;
173 struct gpio_chip *gc;
174 struct gpio_irq_chip *girq;
175 int mapped_irq;
176
177 altera_gc = devm_kzalloc(&pdev->dev, sizeof(*altera_gc), GFP_KERNEL);
178 if (!altera_gc)
179 return -ENOMEM;
180
181 raw_spin_lock_init(&altera_gc->gpio_lock);
182
183 altera_gc->regs = devm_platform_ioremap_resource(pdev, 0);
184 if (IS_ERR(altera_gc->regs))
185 return dev_err_probe(dev, PTR_ERR(altera_gc->regs),
186 "failed to ioremap memory resource\n");
187
188 chip = &altera_gc->chip;
189
190 config = (struct gpio_generic_chip_config) {
191 .dev = dev,
192 .sz = 4,
193 .dat = altera_gc->regs + ALTERA_GPIO_DATA,
194 .set = altera_gc->regs + ALTERA_GPIO_DATA,
195 .dirout = altera_gc->regs + ALTERA_GPIO_DIR,
196 };
197
198 ret = gpio_generic_chip_init(chip, &config);
199 if (ret)
200 return dev_err_probe(dev, ret, "unable to init generic GPIO\n");
201
202 gc = &chip->gc;
203
204 if (device_property_read_u32(dev, "altr,ngpio", ®))
205 /* By default assume maximum ngpio */
206 gc->ngpio = ALTERA_GPIO_MAX_NGPIO;
207 else
208 gc->ngpio = reg;
209
210 if (gc->ngpio > ALTERA_GPIO_MAX_NGPIO) {
211 dev_warn(&pdev->dev,
212 "ngpio is greater than %d, defaulting to %d\n",
213 ALTERA_GPIO_MAX_NGPIO, ALTERA_GPIO_MAX_NGPIO);
214 gc->ngpio = ALTERA_GPIO_MAX_NGPIO;
215 }
216
217 gc->base = -1;
218 gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev));
219 if (!gc->label)
220 return -ENOMEM;
221
222 mapped_irq = platform_get_irq_optional(pdev, 0);
223 if (mapped_irq < 0) {
> 224 if (irq != -ENXIO)
225 return irq;
226 goto skip_irq;
227 }
228
229 if (device_property_read_u32(dev, "altr,interrupt-type", ®)) {
230 dev_err(&pdev->dev,
231 "altr,interrupt-type value not set in device tree\n");
232 return -EINVAL;
233 }
234 altera_gc->interrupt_trigger = reg;
235
236 girq = &gc->irq;
237 gpio_irq_chip_set_chip(girq, &altera_gpio_irq_chip);
238
239 if (altera_gc->interrupt_trigger == IRQ_TYPE_LEVEL_HIGH)
240 girq->parent_handler = altera_gpio_irq_leveL_high_handler;
241 else
242 girq->parent_handler = altera_gpio_irq_edge_handler;
243 girq->num_parents = 1;
244 girq->parents = devm_kcalloc(&pdev->dev, 1, sizeof(*girq->parents),
245 GFP_KERNEL);
246 if (!girq->parents)
247 return -ENOMEM;
248 girq->default_type = IRQ_TYPE_NONE;
249 girq->handler = handle_bad_irq;
250 girq->parents[0] = mapped_irq;
251
252 skip_irq:
253 ret = devm_gpiochip_add_data(dev, gc, altera_gc);
254 if (ret) {
255 dev_err(&pdev->dev, "Failed adding memory mapped gpiochip\n");
256 return ret;
257 }
258
259 return 0;
260 }
261
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-03 12:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 12:15 [brgl:gpio/for-next 5/12] drivers/gpio/gpio-altera.c:224:21: error: 'irq' undeclared; did you mean 'girq'? 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.