summaryrefslogtreecommitdiffstats
path: root/drivers/ssb/sprom.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-11-23 20:12:13 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-11-23 17:05:41 -0500
commit3ba6018aa314559c5867138a8173b068268a70db (patch)
tree6da72b198ec84c40a52b21545b5be3a4b1bd4c74 /drivers/ssb/sprom.c
parent77593ae28c4c134eaf28ef34ecac3cd4464ecd6e (diff)
downloadop-kernel-dev-3ba6018aa314559c5867138a8173b068268a70db.zip
op-kernel-dev-3ba6018aa314559c5867138a8173b068268a70db.tar.gz
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 8943015..580f779 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,
u16 *sprom;
int res = 0, err = -ENOMEM;
size_t sprom_size_words = bus->sprom_size;
+ struct ssb_freeze_context freeze;
sprom = kcalloc(bus->sprom_size, sizeof(u16), GFP_KERNEL);
if (!sprom)
@@ -111,18 +112,13 @@ ssize_t ssb_attr_sprom_store(struct ssb_bus *bus,
err = -ERESTARTSYS;
if (mutex_lock_interruptible(&bus->sprom_mutex))
goto out_kfree;
- err = ssb_devices_freeze(bus);
- if (err == -EOPNOTSUPP) {
- ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze devices. "
- "No suspend support. Is CONFIG_PM enabled?\n");
- goto out_unlock;
- }
+ err = ssb_devices_freeze(bus, &freeze);
if (err) {
ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze all devices\n");
goto out_unlock;
}
res = sprom_write(bus, sprom);
- err = ssb_devices_thaw(bus);
+ err = ssb_devices_thaw(&freeze);
if (err)
ssb_printk(KERN_ERR PFX "SPROM write: Could not thaw all devices\n");
out_unlock:
OpenPOWER on IntegriCloud