sprom.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) sprom.c (b8b6069cf2087545fe53ec920e8353133e9a70bf)
1/*
2 * Sonics Silicon Backplane
3 * Common SPROM support routines
4 *
5 * Copyright (C) 2005-2008 Michael Buesch <m@bues.ch>
6 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de>
7 * Copyright (C) 2005 Stefano Brivio <st3@riseup.net>
8 * Copyright (C) 2005 Danny van Dyk <kugelfang@gentoo.org>

--- 113 unchanged lines hidden (view full) ---

122 /* Use interruptible locking, as the SPROM write might
123 * be holding the lock for several seconds. So allow userspace
124 * to cancel operation. */
125 err = -ERESTARTSYS;
126 if (mutex_lock_interruptible(&bus->sprom_mutex))
127 goto out_kfree;
128 err = ssb_devices_freeze(bus, &freeze);
129 if (err) {
1/*
2 * Sonics Silicon Backplane
3 * Common SPROM support routines
4 *
5 * Copyright (C) 2005-2008 Michael Buesch <m@bues.ch>
6 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de>
7 * Copyright (C) 2005 Stefano Brivio <st3@riseup.net>
8 * Copyright (C) 2005 Danny van Dyk <kugelfang@gentoo.org>

--- 113 unchanged lines hidden (view full) ---

122 /* Use interruptible locking, as the SPROM write might
123 * be holding the lock for several seconds. So allow userspace
124 * to cancel operation. */
125 err = -ERESTARTSYS;
126 if (mutex_lock_interruptible(&bus->sprom_mutex))
127 goto out_kfree;
128 err = ssb_devices_freeze(bus, &freeze);
129 if (err) {
130 ssb_err("SPROM write: Could not freeze all devices\n");
130 pr_err("SPROM write: Could not freeze all devices\n");
131 goto out_unlock;
132 }
133 res = sprom_write(bus, sprom);
134 err = ssb_devices_thaw(&freeze);
135 if (err)
131 goto out_unlock;
132 }
133 res = sprom_write(bus, sprom);
134 err = ssb_devices_thaw(&freeze);
135 if (err)
136 ssb_err("SPROM write: Could not thaw all devices\n");
136 pr_err("SPROM write: Could not thaw all devices\n");
137out_unlock:
138 mutex_unlock(&bus->sprom_mutex);
139out_kfree:
140 kfree(sprom);
141out:
142 if (res)
143 return res;
144 return err ? err : count;

--- 56 unchanged lines hidden ---
137out_unlock:
138 mutex_unlock(&bus->sprom_mutex);
139out_kfree:
140 kfree(sprom);
141out:
142 if (res)
143 return res;
144 return err ? err : count;

--- 56 unchanged lines hidden ---