Lines Matching defs:shared
38 struct flchip_shared *shared;
68 shared = kmalloc_array(lpddr->numchips, sizeof(struct flchip_shared),
70 if (!shared) {
78 shared[i].writing = shared[i].erasing = NULL;
79 mutex_init(&shared[i].lock);
84 chip->priv = &shared[i];
214 * - any write operation must own shared->writing.
216 * - any erase operation must own _both_ shared->writing and
217 * shared->erasing.
221 * The 'shared' struct can be read and/or written only when
224 struct flchip_shared *shared = chip->priv;
226 mutex_lock(&shared->lock);
227 contender = shared->writing;
239 mutex_unlock(&shared->lock);
254 mutex_lock(&shared->lock);
268 if (mode == FL_ERASING && shared->erasing
269 && shared->erasing->oldstate == FL_ERASING) {
270 mutex_unlock(&shared->lock);
281 shared->writing = chip;
283 shared->erasing = chip;
284 mutex_unlock(&shared->lock);
351 struct flchip_shared *shared = chip->priv;
352 mutex_lock(&shared->lock);
353 if (shared->writing == chip && chip->oldstate == FL_READY) {
355 shared->writing = shared->erasing;
356 if (shared->writing && shared->writing != chip) {
358 struct flchip *loaner = shared->writing;
360 mutex_unlock(&shared->lock);
368 shared->erasing = NULL;
369 shared->writing = NULL;
370 } else if (shared->erasing == chip && shared->writing != chip) {
378 mutex_unlock(&shared->lock);
382 mutex_unlock(&shared->lock);