Skip to content

Commit

Permalink
net/c_can: remove conditional compilation of clk code
Browse files Browse the repository at this point in the history
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h,
there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif
macros.

Signed-off-by: Viresh Kumar <[email protected]>
Acked-by: David S. Miller <[email protected]>
Cc: Bhupesh Sharma <[email protected]>
Cc: Russell King <[email protected]>
Cc: Mike Turquette <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: viresh kumar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Viresh Kumar authored and torvalds committed Jul 31, 2012
1 parent d14fb1e commit 2b1463d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/net/can/c_can/c_can_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
const struct platform_device_id *id;
struct resource *mem;
int irq;
#ifdef CONFIG_HAVE_CLK
struct clk *clk;

/* get the appropriate clk */
Expand All @@ -84,7 +83,6 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
ret = -ENODEV;
goto exit;
}
#endif

/* get the platform data */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand Down Expand Up @@ -145,10 +143,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)

dev->irq = irq;
priv->base = addr;
#ifdef CONFIG_HAVE_CLK
priv->can.clock.freq = clk_get_rate(clk);
priv->priv = clk;
#endif

platform_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev);
Expand All @@ -172,10 +168,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
exit_release_mem:
release_mem_region(mem->start, resource_size(mem));
exit_free_clk:
#ifdef CONFIG_HAVE_CLK
clk_put(clk);
exit:
#endif
dev_err(&pdev->dev, "probe failed\n");

return ret;
Expand All @@ -196,9 +190,7 @@ static int __devexit c_can_plat_remove(struct platform_device *pdev)
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem->start, resource_size(mem));

#ifdef CONFIG_HAVE_CLK
clk_put(priv->priv);
#endif

return 0;
}
Expand Down

0 comments on commit 2b1463d

Please sign in to comment.