Skip to content

Commit

Permalink
pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
  • Loading branch information
prabhakarlad authored and krzk committed Dec 25, 2021
1 parent 16dd3bb commit a382d56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/pinctrl/samsung/pinctrl-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,6 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
struct samsung_pinctrl_drv_data *drvdata;
const struct samsung_pin_ctrl *ctrl;
struct device *dev = &pdev->dev;
struct resource *res;
int ret;

drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
Expand All @@ -1109,9 +1108,11 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
}
drvdata->dev = dev;

res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res)
drvdata->irq = res->start;
ret = platform_get_irq_optional(pdev, 0);
if (ret < 0 && ret != -ENXIO)
return ret;
if (ret > 0)
drvdata->irq = ret;

if (ctrl->retention_data) {
drvdata->retention_ctrl = ctrl->retention_data->init(drvdata,
Expand Down

0 comments on commit a382d56

Please sign in to comment.