Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211224145748.18754-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

authored by

Lad Prabhakar and committed by
Krzysztof Kozlowski
a382d568 16dd3bb5

+5 -4
+5 -4
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 1095 1095 struct samsung_pinctrl_drv_data *drvdata; 1096 1096 const struct samsung_pin_ctrl *ctrl; 1097 1097 struct device *dev = &pdev->dev; 1098 - struct resource *res; 1099 1098 int ret; 1100 1099 1101 1100 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); ··· 1108 1109 } 1109 1110 drvdata->dev = dev; 1110 1111 1111 - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1112 - if (res) 1113 - drvdata->irq = res->start; 1112 + ret = platform_get_irq_optional(pdev, 0); 1113 + if (ret < 0 && ret != -ENXIO) 1114 + return ret; 1115 + if (ret > 0) 1116 + drvdata->irq = ret; 1114 1117 1115 1118 if (ctrl->retention_data) { 1116 1119 drvdata->retention_ctrl = ctrl->retention_data->init(drvdata,