@samitouri / QOSamiQemu / commits / fd5c9c3da8

hw/block/pflash: Remove PFlashCFI01::old_multiple_chip_handling field

The PFlashCFI01::old_multiple_chip_handling boolean was only set in the hw_compat_2_8[] array, via the 'old-multiple-chip-handling=on' property. We removed all machines using that array, let's remove that property and all the code around it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250501210456.89071-7-philmd@linaro.org> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260225092024.794595-6-thuth@redhat.com>

Philippe Mathieu-Daudé committed Feb 25, 2026 at 10:20 UTC fd5c9c3da827135de3030446f3afef9a34686187
1 file changed +3 -11
hw/block/pflash_cfi01.c
+3 -11
@@ -84,7 +84,6 @@ struct PFlashCFI01 {
84 char *name;
85 void *storage;
86 VMChangeStateEntry *vmstate;
87 - bool old_multiple_chip_handling;
87
88 /* block update buffer */
89 unsigned char *blk_bytes;
@@ -703,13 +702,8 @@ static void pflash_cfi01_fill_cfi_table(PFlashCFI01 *pfl)
702 * in the cfi_table[].
703 */
704 num_devices = pfl->device_width ? (pfl->bank_width / pfl->device_width) : 1;
706 - if (pfl->old_multiple_chip_handling) {
707 - blocks_per_device = pfl->nb_blocs / num_devices;
708 - sector_len_per_device = pfl->sector_len;
709 - } else {
710 - blocks_per_device = pfl->nb_blocs;
711 - sector_len_per_device = pfl->sector_len / num_devices;
712 - }
705 + blocks_per_device = pfl->nb_blocs;
706 + sector_len_per_device = pfl->sector_len / num_devices;
707 device_len = sector_len_per_device * blocks_per_device;
708
709 /* Hardcoded CFI table */
@@ -765,7 +759,7 @@ static void pflash_cfi01_fill_cfi_table(PFlashCFI01 *pfl)
759 pfl->cfi_table[0x2A] = 0x0B;
760 }
761 pfl->writeblock_size = 1 << pfl->cfi_table[0x2A];
768 - if (!pfl->old_multiple_chip_handling && num_devices > 1) {
762 + if (num_devices > 1) {
763 pfl->writeblock_size *= num_devices;
764 }
765
@@ -930,8 +924,6 @@ static const Property pflash_cfi01_properties[] = {
924 DEFINE_PROP_UINT16("id2", PFlashCFI01, ident2, 0),
925 DEFINE_PROP_UINT16("id3", PFlashCFI01, ident3, 0),
926 DEFINE_PROP_STRING("name", PFlashCFI01, name),
933 - DEFINE_PROP_BOOL("old-multiple-chip-handling", PFlashCFI01,
934 - old_multiple_chip_handling, false),
927 };
928
929 static void pflash_cfi01_class_init(ObjectClass *klass, const void *data)