Commit b416be3a authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Mauro Carvalho Chehab

media: camss: Use platform_get_irq_byname() to get the interrupt

platform_get_resource_byname(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_byname().
Signed-off-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 7dee2cf0
...@@ -562,7 +562,6 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid, ...@@ -562,7 +562,6 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
{ {
struct device *dev = camss->dev; struct device *dev = camss->dev;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct resource *r;
int i, j; int i, j;
int ret; int ret;
...@@ -601,14 +600,11 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid, ...@@ -601,14 +600,11 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
/* Interrupt */ /* Interrupt */
r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, ret = platform_get_irq_byname(pdev, res->interrupt[0]);
res->interrupt[0]); if (ret < 0)
if (!r) { return ret;
dev_err(dev, "missing IRQ\n");
return -EINVAL;
}
csid->irq = r->start; csid->irq = ret;
snprintf(csid->irq_name, sizeof(csid->irq_name), "%s_%s%d", snprintf(csid->irq_name, sizeof(csid->irq_name), "%s_%s%d",
dev_name(dev), MSM_CSID_NAME, csid->id); dev_name(dev), MSM_CSID_NAME, csid->id);
ret = devm_request_irq(dev, csid->irq, csid->ops->isr, ret = devm_request_irq(dev, csid->irq, csid->ops->isr,
......
...@@ -569,7 +569,6 @@ int msm_csiphy_subdev_init(struct camss *camss, ...@@ -569,7 +569,6 @@ int msm_csiphy_subdev_init(struct camss *camss,
{ {
struct device *dev = camss->dev; struct device *dev = camss->dev;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct resource *r;
int i, j; int i, j;
int ret; int ret;
...@@ -613,14 +612,11 @@ int msm_csiphy_subdev_init(struct camss *camss, ...@@ -613,14 +612,11 @@ int msm_csiphy_subdev_init(struct camss *camss,
/* Interrupt */ /* Interrupt */
r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, ret = platform_get_irq_byname(pdev, res->interrupt[0]);
res->interrupt[0]); if (ret < 0)
if (!r) { return ret;
dev_err(dev, "missing IRQ\n");
return -EINVAL;
}
csiphy->irq = r->start; csiphy->irq = ret;
snprintf(csiphy->irq_name, sizeof(csiphy->irq_name), "%s_%s%d", snprintf(csiphy->irq_name, sizeof(csiphy->irq_name), "%s_%s%d",
dev_name(dev), MSM_CSIPHY_NAME, csiphy->id); dev_name(dev), MSM_CSIPHY_NAME, csiphy->id);
......
...@@ -1100,7 +1100,6 @@ int msm_ispif_subdev_init(struct camss *camss, ...@@ -1100,7 +1100,6 @@ int msm_ispif_subdev_init(struct camss *camss,
struct device *dev = camss->dev; struct device *dev = camss->dev;
struct ispif_device *ispif = camss->ispif; struct ispif_device *ispif = camss->ispif;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct resource *r;
int i; int i;
int ret; int ret;
...@@ -1153,14 +1152,11 @@ int msm_ispif_subdev_init(struct camss *camss, ...@@ -1153,14 +1152,11 @@ int msm_ispif_subdev_init(struct camss *camss,
/* Interrupt */ /* Interrupt */
r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res->interrupt); ret = platform_get_irq_byname(pdev, res->interrupt);
if (ret < 0)
if (!r) { return ret;
dev_err(dev, "missing IRQ\n");
return -EINVAL;
}
ispif->irq = r->start; ispif->irq = ret;
snprintf(ispif->irq_name, sizeof(ispif->irq_name), "%s_%s", snprintf(ispif->irq_name, sizeof(ispif->irq_name), "%s_%s",
dev_name(dev), MSM_ISPIF_NAME); dev_name(dev), MSM_ISPIF_NAME);
if (camss->version == CAMSS_8x16) if (camss->version == CAMSS_8x16)
......
...@@ -1281,7 +1281,6 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, ...@@ -1281,7 +1281,6 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
{ {
struct device *dev = camss->dev; struct device *dev = camss->dev;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct resource *r;
int i, j; int i, j;
int ret; int ret;
...@@ -1316,14 +1315,11 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, ...@@ -1316,14 +1315,11 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
/* Interrupt */ /* Interrupt */
r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, ret = platform_get_irq_byname(pdev, res->interrupt[0]);
res->interrupt[0]); if (ret < 0)
if (!r) { return ret;
dev_err(dev, "missing IRQ\n");
return -EINVAL;
}
vfe->irq = r->start; vfe->irq = ret;
snprintf(vfe->irq_name, sizeof(vfe->irq_name), "%s_%s%d", snprintf(vfe->irq_name, sizeof(vfe->irq_name), "%s_%s%d",
dev_name(dev), MSM_VFE_NAME, id); dev_name(dev), MSM_VFE_NAME, id);
ret = devm_request_irq(dev, vfe->irq, vfe->ops->isr, ret = devm_request_irq(dev, vfe->irq, vfe->ops->isr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment