Lines Matching defs:shared
718 struct flchip_shared *shared;
782 shared = kmalloc_array(cfi->numchips,
785 if (!shared) {
795 shared[i].writing = shared[i].erasing = NULL;
796 mutex_init(&shared[i].lock);
800 chip->priv = &shared[i];
959 * - any write operation must own shared->writing.
961 * - any erase operation must own _both_ shared->writing and
962 * shared->erasing.
966 * The 'shared' struct can be read and/or written only when
969 struct flchip_shared *shared = chip->priv;
971 mutex_lock(&shared->lock);
972 contender = shared->writing;
984 mutex_unlock(&shared->lock);
999 mutex_lock(&shared->lock);
1013 if (mode == FL_ERASING && shared->erasing
1014 && shared->erasing->oldstate == FL_ERASING) {
1015 mutex_unlock(&shared->lock);
1026 shared->writing = chip;
1028 shared->erasing = chip;
1029 mutex_unlock(&shared->lock);
1043 struct flchip_shared *shared = chip->priv;
1044 mutex_lock(&shared->lock);
1045 if (shared->writing == chip && chip->oldstate == FL_READY) {
1047 shared->writing = shared->erasing;
1048 if (shared->writing && shared->writing != chip) {
1050 struct flchip *loaner = shared->writing;
1052 mutex_unlock(&shared->lock);
1060 shared->erasing = NULL;
1061 shared->writing = NULL;
1062 } else if (shared->erasing == chip && shared->writing != chip) {
1070 mutex_unlock(&shared->lock);
1074 mutex_unlock(&shared->lock);