Lines Matching defs:shared
720 struct flchip_shared *shared;
784 shared = kmalloc_array(cfi->numchips,
787 if (!shared) {
797 shared[i].writing = shared[i].erasing = NULL;
798 mutex_init(&shared[i].lock);
802 chip->priv = &shared[i];
961 * - any write operation must own shared->writing.
963 * - any erase operation must own _both_ shared->writing and
964 * shared->erasing.
968 * The 'shared' struct can be read and/or written only when
971 struct flchip_shared *shared = chip->priv;
973 mutex_lock(&shared->lock);
974 contender = shared->writing;
986 mutex_unlock(&shared->lock);
1001 mutex_lock(&shared->lock);
1015 if (mode == FL_ERASING && shared->erasing
1016 && shared->erasing->oldstate == FL_ERASING) {
1017 mutex_unlock(&shared->lock);
1028 shared->writing = chip;
1030 shared->erasing = chip;
1031 mutex_unlock(&shared->lock);
1045 struct flchip_shared *shared = chip->priv;
1046 mutex_lock(&shared->lock);
1047 if (shared->writing == chip && chip->oldstate == FL_READY) {
1049 shared->writing = shared->erasing;
1050 if (shared->writing && shared->writing != chip) {
1052 struct flchip *loaner = shared->writing;
1054 mutex_unlock(&shared->lock);
1062 shared->erasing = NULL;
1063 shared->writing = NULL;
1064 } else if (shared->erasing == chip && shared->writing != chip) {
1072 mutex_unlock(&shared->lock);
1076 mutex_unlock(&shared->lock);