[PATCHv6 38/45] ARM: OMAP2+: omap_device: use dev pointer to optimize code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




From: Nishanth Menon <nm@xxxxxx>

_add_clkdev uses &od->pdev->dev for all reference of device struct.

Simplify the usage with a variable.

Signed-off-by: Nishanth Menon <nm@xxxxxx>
Signed-off-by: Tero Kristo <t-kristo@xxxxxx>
---
 arch/arm/mach-omap2/omap_device.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index f99f68e..070d17b 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -47,31 +47,29 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
 {
 	struct clk *r;
 	struct clk_lookup *l;
+	struct device *dev = &od->pdev->dev;
 
 	if (!clk_alias || !clk_name)
 		return;
 
-	dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name);
+	dev_dbg(dev, "Creating %s -> %s\n", clk_alias, clk_name);
 
-	r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias);
+	r = clk_get_sys(dev_name(dev), clk_alias);
 	if (!IS_ERR(r)) {
-		dev_warn(&od->pdev->dev,
-			 "alias %s already exists\n", clk_alias);
+		dev_warn(dev, "alias %s already exists\n", clk_alias);
 		clk_put(r);
 		return;
 	}
 
 	r = clk_get(NULL, clk_name);
 	if (IS_ERR(r)) {
-		dev_err(&od->pdev->dev,
-			"clk_get for %s failed\n", clk_name);
+		dev_err(dev, "clk_get for %s failed\n", clk_name);
 		return;
 	}
 
-	l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev));
+	l = clkdev_alloc(r, clk_alias, dev_name(dev));
 	if (!l) {
-		dev_err(&od->pdev->dev,
-			"clkdev_alloc for %s failed\n", clk_alias);
+		dev_err(dev, "clkdev_alloc for %s failed\n", clk_alias);
 		return;
 	}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux