Lines Matching refs:rt2x00dev
23 static void rt2x00soc_free_reg(struct rt2x00_dev *rt2x00dev) in rt2x00soc_free_reg() argument
25 kfree(rt2x00dev->rf); in rt2x00soc_free_reg()
26 rt2x00dev->rf = NULL; in rt2x00soc_free_reg()
28 kfree(rt2x00dev->eeprom); in rt2x00soc_free_reg()
29 rt2x00dev->eeprom = NULL; in rt2x00soc_free_reg()
31 iounmap(rt2x00dev->csr.base); in rt2x00soc_free_reg()
34 static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev) in rt2x00soc_alloc_reg() argument
36 struct platform_device *pdev = to_platform_device(rt2x00dev->dev); in rt2x00soc_alloc_reg()
43 rt2x00dev->csr.base = ioremap(res->start, resource_size(res)); in rt2x00soc_alloc_reg()
44 if (!rt2x00dev->csr.base) in rt2x00soc_alloc_reg()
47 rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL); in rt2x00soc_alloc_reg()
48 if (!rt2x00dev->eeprom) in rt2x00soc_alloc_reg()
51 rt2x00dev->rf = kzalloc(rt2x00dev->ops->rf_size, GFP_KERNEL); in rt2x00soc_alloc_reg()
52 if (!rt2x00dev->rf) in rt2x00soc_alloc_reg()
59 rt2x00soc_free_reg(rt2x00dev); in rt2x00soc_alloc_reg()
67 struct rt2x00_dev *rt2x00dev; in rt2x00soc_probe() local
78 rt2x00dev = hw->priv; in rt2x00soc_probe()
79 rt2x00dev->dev = &pdev->dev; in rt2x00soc_probe()
80 rt2x00dev->ops = ops; in rt2x00soc_probe()
81 rt2x00dev->hw = hw; in rt2x00soc_probe()
82 rt2x00dev->irq = platform_get_irq(pdev, 0); in rt2x00soc_probe()
83 rt2x00dev->name = pdev->dev.driver->name; in rt2x00soc_probe()
85 rt2x00dev->clk = clk_get(&pdev->dev, NULL); in rt2x00soc_probe()
86 if (IS_ERR(rt2x00dev->clk)) in rt2x00soc_probe()
87 rt2x00dev->clk = NULL; in rt2x00soc_probe()
89 rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); in rt2x00soc_probe()
91 retval = rt2x00soc_alloc_reg(rt2x00dev); in rt2x00soc_probe()
95 retval = rt2x00lib_probe_dev(rt2x00dev); in rt2x00soc_probe()
102 rt2x00soc_free_reg(rt2x00dev); in rt2x00soc_probe()
114 struct rt2x00_dev *rt2x00dev = hw->priv; in rt2x00soc_remove() local
119 rt2x00lib_remove_dev(rt2x00dev); in rt2x00soc_remove()
120 rt2x00soc_free_reg(rt2x00dev); in rt2x00soc_remove()
131 struct rt2x00_dev *rt2x00dev = hw->priv; in rt2x00soc_suspend() local
133 return rt2x00lib_suspend(rt2x00dev); in rt2x00soc_suspend()
140 struct rt2x00_dev *rt2x00dev = hw->priv; in rt2x00soc_resume() local
142 return rt2x00lib_resume(rt2x00dev); in rt2x00soc_resume()