mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
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>
This commit is contained in:
committed by
Krzysztof Kozlowski
parent
16dd3bb5c1
commit
a382d568f1
@@ -1095,7 +1095,6 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
|
|||||||
struct samsung_pinctrl_drv_data *drvdata;
|
struct samsung_pinctrl_drv_data *drvdata;
|
||||||
const struct samsung_pin_ctrl *ctrl;
|
const struct samsung_pin_ctrl *ctrl;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct resource *res;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
|
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
|
||||||
@@ -1109,9 +1108,11 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
drvdata->dev = dev;
|
drvdata->dev = dev;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
ret = platform_get_irq_optional(pdev, 0);
|
||||||
if (res)
|
if (ret < 0 && ret != -ENXIO)
|
||||||
drvdata->irq = res->start;
|
return ret;
|
||||||
|
if (ret > 0)
|
||||||
|
drvdata->irq = ret;
|
||||||
|
|
||||||
if (ctrl->retention_data) {
|
if (ctrl->retention_data) {
|
||||||
drvdata->retention_ctrl = ctrl->retention_data->init(drvdata,
|
drvdata->retention_ctrl = ctrl->retention_data->init(drvdata,
|
||||||
|
|||||||
Reference in New Issue
Block a user