Commit b0052b08 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by David S. Miller

can: c_can_platform: fix irq check in probe

This patch fixes the check in the probe function whether a IRQ was supplied
to the driver. The original driver check the irq "struct resource *" against
<= 0. Use "platform_get_irq" instead.
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee6f0988
...@@ -73,7 +73,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) ...@@ -73,7 +73,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
void __iomem *addr; void __iomem *addr;
struct net_device *dev; struct net_device *dev;
struct c_can_priv *priv; struct c_can_priv *priv;
struct resource *mem, *irq; struct resource *mem;
int irq;
#ifdef CONFIG_HAVE_CLK #ifdef CONFIG_HAVE_CLK
struct clk *clk; struct clk *clk;
...@@ -88,8 +89,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) ...@@ -88,8 +89,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
/* get the platform data */ /* get the platform data */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irq = platform_get_irq(pdev, 0);
if (!mem || (irq <= 0)) { if (!mem || irq <= 0) {
ret = -ENODEV; ret = -ENODEV;
goto exit_free_clk; goto exit_free_clk;
} }
...@@ -117,7 +118,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) ...@@ -117,7 +118,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
priv = netdev_priv(dev); priv = netdev_priv(dev);
dev->irq = irq->start; dev->irq = irq;
priv->regs = addr; priv->regs = addr;
#ifdef CONFIG_HAVE_CLK #ifdef CONFIG_HAVE_CLK
priv->can.clock.freq = clk_get_rate(clk); priv->can.clock.freq = clk_get_rate(clk);
......
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