aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb/sprom.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-11-23 14:12:13 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-23 17:05:41 -0500
commit3ba6018aa314559c5867138a8173b068268a70db (patch)
tree6da72b198ec84c40a52b21545b5be3a4b1bd4c74 /drivers/ssb/sprom.c
parent77593ae28c4c134eaf28ef34ecac3cd4464ecd6e (diff)
ssb: Fix SPROM writing
The SPROM writing routines were broken since we rewrote the suspend handling on wireless devices, because SPROM writing depended on suspend. This patch changes it and freezes devices with the driver remove(), probe() callbacks instead. This also simplifies the whole logics a lot. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/sprom.c')
-rw-r--r--drivers/ssb/sprom.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/ssb/sprom.c b/drivers/ssb/sprom.c
index 8943015a3eef..580f779ecf49 100644
--- a/drivers/ssb/sprom.c
+++ b/drivers/ssb/sprom.c
@@ -90,6 +90,7 @@ ssize_t ssb_attr_sprom_store(struct ssb_bus *bus,
90 u16 *sprom; 90 u16 *sprom;
91 int res = 0, err = -ENOMEM; 91 int res = 0, err = -ENOMEM;
92 size_t sprom_size_words = bus->sprom_size; 92 size_t sprom_size_words = bus->sprom_size;
93 struct ssb_freeze_context freeze;
93 94
94 sprom = kcalloc(bus->sprom_size, sizeof(u16), GFP_KERNEL); 95 sprom = kcalloc(bus->sprom_size, sizeof(u16), GFP_KERNEL);
95 if (!sprom) 96 if (!sprom)
@@ -111,18 +112,13 @@ ssize_t ssb_attr_sprom_store(struct ssb_bus *bus,
111 err = -ERESTARTSYS; 112 err = -ERESTARTSYS;
112 if (mutex_lock_interruptible(&bus->sprom_mutex)) 113 if (mutex_lock_interruptible(&bus->sprom_mutex))
113 goto out_kfree; 114 goto out_kfree;
114 err = ssb_devices_freeze(bus); 115 err = ssb_devices_freeze(bus, &freeze);
115 if (err == -EOPNOTSUPP) {
116 ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze devices. "
117 "No suspend support. Is CONFIG_PM enabled?\n");
118 goto out_unlock;
119 }
120 if (err) { 116 if (err) {
121 ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze all devices\n"); 117 ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze all devices\n");
122 goto out_unlock; 118 goto out_unlock;
123 } 119 }
124 res = sprom_write(bus, sprom); 120 res = sprom_write(bus, sprom);
125 err = ssb_devices_thaw(bus); 121 err = ssb_devices_thaw(&freeze);
126 if (err) 122 if (err)
127 ssb_printk(KERN_ERR PFX "SPROM write: Could not thaw all devices\n"); 123 ssb_printk(KERN_ERR PFX "SPROM write: Could not thaw all devices\n");
128out_unlock: 124out_unlock: