unsigned int irq_of_parse_and_map(struct device_node *dev, int index) 函数返回值什么
时间: 2023-12-12 19:04:39 浏览: 268
浅谈c++ 字符类型总结区别wchar_t,char,WCHAR
5星 · 资源好评率100%
The function `irq_of_parse_and_map()` returns the mapped interrupt number for a given interrupt specifier in the device tree.
The returned value is of type `unsigned int`, which represents the mapped interrupt number that can be used to request and manage interrupts in the system. If the function fails to parse or map the interrupt, it returns an error code, usually a negative integer.
Here is an example usage of `irq_of_parse_and_map()` function:
```
int irq_num = irq_of_parse_and_map(dev, index);
if (irq_num < 0) {
// error handling
}
else {
// interrupt handling
}
```
In this example, the function `irq_of_parse_and_map()` is used to parse and map the interrupt for a given device node `dev` and interrupt index `index`. The mapped interrupt number is stored in the variable `irq_num`, which is then used for interrupt handling. If the function fails to parse or map the interrupt, it returns a negative error code.
阅读全文