Lines Matching refs:shared
681 struct flchip_shared *shared; in cfi_intelext_partition_fixup() local
743 shared = kmalloc(sizeof(struct flchip_shared) * cfi->numchips, GFP_KERNEL); in cfi_intelext_partition_fixup()
744 if (!shared) { in cfi_intelext_partition_fixup()
754 shared[i].writing = shared[i].erasing = NULL; in cfi_intelext_partition_fixup()
755 mutex_init(&shared[i].lock); in cfi_intelext_partition_fixup()
759 chip->priv = &shared[i]; in cfi_intelext_partition_fixup()
919 struct flchip_shared *shared = chip->priv; in get_chip() local
921 mutex_lock(&shared->lock); in get_chip()
922 contender = shared->writing; in get_chip()
934 mutex_unlock(&shared->lock); in get_chip()
949 mutex_lock(&shared->lock); in get_chip()
963 if (mode == FL_ERASING && shared->erasing in get_chip()
964 && shared->erasing->oldstate == FL_ERASING) { in get_chip()
965 mutex_unlock(&shared->lock); in get_chip()
976 shared->writing = chip; in get_chip()
978 shared->erasing = chip; in get_chip()
979 mutex_unlock(&shared->lock); in get_chip()
993 struct flchip_shared *shared = chip->priv; in put_chip() local
994 mutex_lock(&shared->lock); in put_chip()
995 if (shared->writing == chip && chip->oldstate == FL_READY) { in put_chip()
997 shared->writing = shared->erasing; in put_chip()
998 if (shared->writing && shared->writing != chip) { in put_chip()
1000 struct flchip *loaner = shared->writing; in put_chip()
1002 mutex_unlock(&shared->lock); in put_chip()
1010 shared->erasing = NULL; in put_chip()
1011 shared->writing = NULL; in put_chip()
1012 } else if (shared->erasing == chip && shared->writing != chip) { in put_chip()
1020 mutex_unlock(&shared->lock); in put_chip()
1024 mutex_unlock(&shared->lock); in put_chip()