]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rt2x00: add copy of clk for soc devices
authorStanislaw Gruszka <sgruszka@redhat.com>
Fri, 20 Jan 2017 13:28:24 +0000 (14:28 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 28 Jan 2017 07:03:45 +0000 (09:03 +0200)
Since clk_get() is not trivial add copy of clk pointer to rt2x00dev
for System On Chip devices and initialize it on probe routine.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2x00.h
drivers/net/wireless/ralink/rt2x00/rt2x00soc.c

index bea7ac30522f3a5b1f08c8a943d2b5498e6ef5b1..b59e721c8a5de1980ab8584bf76191d66332d14c 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/hrtimer.h>
 #include <linux/average.h>
 #include <linux/usb.h>
+#include <linux/clk.h>
 
 #include <net/mac80211.h>
 
@@ -1011,6 +1012,9 @@ struct rt2x00_dev {
        unsigned int extra_tx_headroom;
 
        struct usb_anchor *anchor;
+
+       /* Clock for System On Chip devices. */
+       struct clk *clk;
 };
 
 struct rt2x00_bar_list_entry {
index 69a0cdadb07f3d46a23fb8530c62d631233de743..362f9d3b98fc1a55e0e7e86bf4cbc9aa8df5f983 100644 (file)
@@ -92,6 +92,7 @@ int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops)
        rt2x00dev->hw = hw;
        rt2x00dev->irq = platform_get_irq(pdev, 0);
        rt2x00dev->name = pdev->dev.driver->name;
+       rt2x00dev->clk = clk_get(&pdev->dev);
 
        rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);