if (WARN(!ret, "0 is an invalid IRQ number\n")) return -EINVAL; return ret; } EXPORT_SYMBOL_GPL(platform_get_irq_optional); @@ -446,7 +447,8 @@ static int __platform_get_irq_byname(struct platform_device *dev,r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); ...
The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- changes in v2 : irq was unsigned. so changed it to signed....
51CTO博客已为您找到关于platform_get_irq的相关内容,包含IT学习相关文档代码介绍、相关教程视频课程,以及platform_get_irq问答内容。更多platform_get_irq相关解答可以来51CTO博客参与分享和学习,帮助广大IT技术人实现成长和进步。
*/staticintzynq_gpio_probe(struct platform_device *pdev){intret, pin_num, bank_num, gpio_irq;unsignedintirq_num;structzynq_gpio*gpio;structgpio_chip*chip;structresource*res;gpio = devm_kzalloc(&pdev->dev,sizeof(*gpio), GFP_KERNEL);if(!gpio)return-ENOMEM; platform_set_drvdata(pdev, g...
irq =platform_get_irq_byname(pdev,"ONKEY");if(irq <0) { dev_err(&pdev->dev,"Failed to get an IRQ for input device, %d\n", irq);return-EINVAL; } onkey = devm_kzalloc(&pdev->dev,sizeof(*onkey), GFP_KERNEL);if(!onkey) { ...
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform...
irqc->name = dev_name(&pdev->dev); - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (unlikely(!res)) { - dev_err(dev, "Invalid IRQ resource\n"); - return -ENODEV; + bank->irq = platform_get_irq(pdev, 0); ...
对于IRQ而言,platform_get_resource()还有一个进行了封装的变体platform_get_irq(),其原型为: int platform_get_irq(struct platform_device *dev, unsigned int num); 它实际上调用了“platform_get_resource(dev, IORESOURCE_IRQ, num);”。 设备除了可以在BSP中定义资源以外,还可以附加一些数据信息,因为对设备...
= num_irq) pr_debug("not all legacy IRQ resources mapped for %s\n", np->name); } dev->dev.of_node = of_node_get(np); dev->dev.parent = parent ? : &platform_bus; if (bus_id) dev_set_name(&dev->dev, "%s", bus_id); else of_device_make_bus_id(&dev->dev); return ...