Messages in this thread | | | Subject | Re: [PATCH v5 1/3] driver core: platform: Add an error message to platform_get_irq*() | From | Markus Elfring <> | Date | Tue, 30 Jul 2019 14:30:44 +0200 |
| |
… > +++ b/drivers/base/platform.c … > @@ -163,6 +158,33 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) > return -ENXIO; > #endif > } > + > +/** > + * platform_get_irq - get an IRQ for a device > + * @dev: platform device > + * @num: IRQ number index > + * > + * Gets an IRQ for a platform device and prints an error message if finding the > + * IRQ fails. Device drivers should check the return value for errors so as to > + * not pass a negative integer value to the request_irq() APIs. > + * > + * Example: > + * int irq = platform_get_irq(pdev, 0); > + * if (irq < 0) > + * return irq; > + * > + * Return: IRQ number on success, negative error number on failure. > + */ …
Thanks for your extension of the description for this programming interface.
I imagine that adjustments for this software documentation format can make it safer to extract desired API properties. Would you like to improve provided information any further?
Regards, Markus
| |