Lines Matching refs:shared
720 struct flchip_shared *shared; in cfi_intelext_partition_fixup() local
784 shared = kmalloc_array(cfi->numchips, in cfi_intelext_partition_fixup()
787 if (!shared) { in cfi_intelext_partition_fixup()
797 shared[i].writing = shared[i].erasing = NULL; in cfi_intelext_partition_fixup()
798 mutex_init(&shared[i].lock); in cfi_intelext_partition_fixup()
802 chip->priv = &shared[i]; in cfi_intelext_partition_fixup()
971 struct flchip_shared *shared = chip->priv; in get_chip() local
973 mutex_lock(&shared->lock); in get_chip()
974 contender = shared->writing; in get_chip()
986 mutex_unlock(&shared->lock); in get_chip()
1001 mutex_lock(&shared->lock); in get_chip()
1015 if (mode == FL_ERASING && shared->erasing in get_chip()
1016 && shared->erasing->oldstate == FL_ERASING) { in get_chip()
1017 mutex_unlock(&shared->lock); in get_chip()
1028 shared->writing = chip; in get_chip()
1030 shared->erasing = chip; in get_chip()
1031 mutex_unlock(&shared->lock); in get_chip()
1045 struct flchip_shared *shared = chip->priv; in put_chip() local
1046 mutex_lock(&shared->lock); in put_chip()
1047 if (shared->writing == chip && chip->oldstate == FL_READY) { in put_chip()
1049 shared->writing = shared->erasing; in put_chip()
1050 if (shared->writing && shared->writing != chip) { in put_chip()
1052 struct flchip *loaner = shared->writing; in put_chip()
1054 mutex_unlock(&shared->lock); in put_chip()
1062 shared->erasing = NULL; in put_chip()
1063 shared->writing = NULL; in put_chip()
1064 } else if (shared->erasing == chip && shared->writing != chip) { in put_chip()
1072 mutex_unlock(&shared->lock); in put_chip()
1076 mutex_unlock(&shared->lock); in put_chip()