Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / drivers / pci / controller / pcie-xilinx-nwl.c
index 3d178d5..a72b4f9 100644 (file)
@@ -6,6 +6,7 @@
  * (C) Copyright 2014 - 2015, Xilinx, Inc.
  */
 
+#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -169,6 +170,7 @@ struct nwl_pcie {
        u8 last_busno;
        struct nwl_msi msi;
        struct irq_domain *legacy_irq_domain;
+       struct clk *clk;
        raw_spinlock_t leg_mask_lock;
 };
 
@@ -816,6 +818,16 @@ static int nwl_pcie_probe(struct platform_device *pdev)
                return err;
        }
 
+       pcie->clk = devm_clk_get(dev, NULL);
+       if (IS_ERR(pcie->clk))
+               return PTR_ERR(pcie->clk);
+
+       err = clk_prepare_enable(pcie->clk);
+       if (err) {
+               dev_err(dev, "can't enable PCIe ref clock\n");
+               return err;
+       }
+
        err = nwl_pcie_bridge_init(pcie);
        if (err) {
                dev_err(dev, "HW Initialization failed\n");