]> git.sur5r.net Git - openocd/commitdiff
flash/nor: implement flash bank deallocation in drivers with simple alloc
authorTomas Vanek <vanekt@fbl.cz>
Thu, 15 Feb 2018 09:25:50 +0000 (10:25 +0100)
committerMatthias Welwarsky <matthias@welwarsky.de>
Wed, 4 Apr 2018 19:14:18 +0000 (20:14 +0100)
All drivers which simply allocate one driver_priv memory block
per each bank now use default_flash_free_driver_priv()

Change-Id: I425bf4213c3632f02dbe11ab819c31eda9b2db62
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4417
Tested-by: jenkins
Reviewed-by: Liviu Dudau <liviu@dudau.co.uk>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
40 files changed:
src/flash/nor/ambiqmicro.c
src/flash/nor/ath79.c
src/flash/nor/atsamv.c
src/flash/nor/avrf.c
src/flash/nor/cfi.c
src/flash/nor/efm32.c
src/flash/nor/em357.c
src/flash/nor/faux.c
src/flash/nor/fm3.c
src/flash/nor/fm4.c
src/flash/nor/jtagspi.c
src/flash/nor/kinetis_ke.c
src/flash/nor/lpc2000.c
src/flash/nor/lpc288x.c
src/flash/nor/lpc2900.c
src/flash/nor/lpcspifi.c
src/flash/nor/mdr.c
src/flash/nor/mrvlqspi.c
src/flash/nor/niietcm4.c
src/flash/nor/numicro.c
src/flash/nor/ocl.c
src/flash/nor/pic32mx.c
src/flash/nor/psoc4.c
src/flash/nor/psoc6.c
src/flash/nor/sim3x.c
src/flash/nor/stellaris.c
src/flash/nor/stm32f1x.c
src/flash/nor/stm32f2x.c
src/flash/nor/stm32h7x.c
src/flash/nor/stm32l4x.c
src/flash/nor/stm32lx.c
src/flash/nor/stmsmi.c
src/flash/nor/str7x.c
src/flash/nor/str9x.c
src/flash/nor/str9xpec.c
src/flash/nor/tms470.c
src/flash/nor/virtual.c
src/flash/nor/xcf.c
src/flash/nor/xmc1xxx.c
src/flash/nor/xmc4xxx.c

index b2c30e6f46b943021dc11e89428290e2841322cb..13b2b26ae3abaa0d999aaaa2df2781e54cec3661 100644 (file)
@@ -901,4 +901,5 @@ struct flash_driver ambiqmicro_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = ambiqmicro_protect_check,
        .info = get_ambiqmicro_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 451e843658b127546723cc34407d04760d87bccd..c5f9eed52f7e4be1ea3568b5be062d3c7c122647 100644 (file)
@@ -898,4 +898,5 @@ struct flash_driver ath79_flash = {
        .erase_check = ath79_flash_blank_check,
        .protect_check = ath79_protect_check,
        .info = get_ath79_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 73f02389618b60de5067720e99ad4ff63d0a6ef7..9c07bdf152f415cbbbafb452e7fb292e28156bf7 100644 (file)
@@ -739,4 +739,5 @@ struct flash_driver atsamv_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = samv_protect_check,
        .info = samv_get_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 11cc3b2d329fe8b0415368352d453b21d05a90c8..65ac6015f0a69443532df1f489081a9dc6aecd6c 100644 (file)
@@ -487,4 +487,5 @@ struct flash_driver avr_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = avrf_protect_check,
        .info = avrf_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index ac0db8271d61098410701a138a005dd166ea1ea1..0ae72d4a28be45756f8f122e8ea6d5552099577b 100644 (file)
@@ -3128,4 +3128,5 @@ struct flash_driver cfi_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = cfi_protect_check,
        .info = get_cfi_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 282b6bdddafee0b60c2232aedea056cf6a780aa8..1d70bd501724ab624d45fc8fc1efcb175e433a13 100644 (file)
@@ -1133,4 +1133,5 @@ struct flash_driver efm32_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = efm32x_protect_check,
        .info = get_efm32x_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index a11743b559513c6424256f53b2f6b073a6f33aab..b14e0323c7916e272f66c073a07351d3d930d8b9 100644 (file)
@@ -941,4 +941,5 @@ struct flash_driver em357_flash = {
        .auto_probe = em357_auto_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = em357_protect_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 203eb6fff3cccfbcf1589712d75930a19c5a39e6..46eda722334c4201a2f22711d75a131e2f7c70b8 100644 (file)
@@ -136,5 +136,6 @@ struct flash_driver faux_flash = {
        .auto_probe = faux_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = faux_protect_check,
-       .info = faux_info
+       .info = faux_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 6269a6536c683259d39cc0e60f39ec3c4f5bcd66..6c619775ac149124454ab15722dd398dde0b23bc 100644 (file)
@@ -997,4 +997,5 @@ struct flash_driver fm3_flash = {
        .probe = fm3_probe,
        .auto_probe = fm3_auto_probe,
        .erase_check = default_flash_blank_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index c8fe8b66f72bd0ecc7c2b1d8db8b117573de292f..f5eab9c5b39c39444f08de3956344213bd4e1b8b 100644 (file)
@@ -719,4 +719,5 @@ struct flash_driver fm4_flash = {
        .erase = fm4_flash_erase,
        .erase_check = default_flash_blank_check,
        .write = fm4_flash_write,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index a73812d88a856b8783c1be83ffbbb95c024f688e..c28ad22f7a823b7cb6fb14a9ad74a5f6ec417291 100644 (file)
@@ -432,5 +432,6 @@ struct flash_driver jtagspi_flash = {
        .auto_probe = jtagspi_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = jtagspi_protect_check,
-       .info = jtagspi_info
+       .info = jtagspi_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index b7a6a1ece15da6e78c79e7776243c1042dbfad93..8103b6394cbcb6fbd8f39196a8aaf0b37fe15518 100644 (file)
@@ -1310,4 +1310,5 @@ struct flash_driver kinetis_ke_flash = {
        .erase_check = kinetis_ke_blank_check,
        .protect_check = kinetis_ke_protect_check,
        .info = kinetis_ke_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 9da5da2cac282eebbb7e262df4483e3d7972f0e9..8e15c3122dcf99d655134662ca6b1a3c2278ed2f 100644 (file)
@@ -1579,4 +1579,5 @@ struct flash_driver lpc2000_flash = {
        .erase_check = lpc2000_erase_check,
        .protect_check = lpc2000_protect_check,
        .info = get_lpc2000_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index a4d88de78f7c6f2d81bb79f36204a9607b082348..24729138a0228a11b3096fcd81212a5e62928489 100644 (file)
@@ -433,4 +433,5 @@ struct flash_driver lpc288x_flash = {
        .auto_probe = lpc288x_probe,
        .erase_check = lpc288x_erase_check,
        .protect_check = lpc288x_protect_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 515a3f7b2889bfbeb556eb99c680a349531a672f..1c65933e21a8fdb44c865b34dfb091f911a4aeed 100644 (file)
@@ -1598,4 +1598,5 @@ struct flash_driver lpc2900_flash = {
        .auto_probe = lpc2900_probe,
        .erase_check = lpc2900_erase_check,
        .protect_check = lpc2900_protect_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 943c151e22f0df37d174ddacfd0458e5a40602a2..828c60ca6e0e0bd9ecd8337d7773f625d6e19792 100644 (file)
@@ -942,4 +942,5 @@ struct flash_driver lpcspifi_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = lpcspifi_protect_check,
        .info = get_lpcspifi_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 8ceb1bf46573b8fb9956dcca44a32f00fbeb0f64..f3916ded98fe9f4a5e02397fcb167cd0a2960b28 100644 (file)
@@ -633,4 +633,5 @@ struct flash_driver mdr_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = mdr_protect_check,
        .info = get_mdr_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index d79917058c666af610a49db7ebfd79f3e2f73ace..eda6cc1ad2e079ed0c49bce380c9c80ccf605a40 100644 (file)
@@ -955,4 +955,5 @@ struct flash_driver mrvlqspi_flash = {
        .erase_check = mrvlqspi_flash_erase_check,
        .protect_check = mrvlqspi_protect_check,
        .info = mrvlqspi_get_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 4a849fd26eab52b65eed7c0333c4c629f1ee78a5..fd7d519a86b19e93b957fe842a47f8dfe10c8b43 100644 (file)
@@ -1741,4 +1741,5 @@ struct flash_driver niietcm4_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = niietcm4_protect_check,
        .info = get_niietcm4_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 992baa5155b4a112dcaf346dc5b88933139243fb..4d951f0eeaad982e734bf9c3c27bf9cb0d71f50b 100644 (file)
@@ -1880,4 +1880,5 @@ struct flash_driver numicro_flash = {
        .auto_probe = numicro_auto_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = numicro_protect_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 4ae5652194b784bd703aac0a9b5dcc66a2a11c5d..895c4af219374f54f0636c201dd5290c88dc562c 100644 (file)
@@ -340,4 +340,5 @@ struct flash_driver ocl_flash = {
        .erase_check = ocl_erase_check,
        .protect_check = ocl_protect_check,
        .auto_probe = ocl_auto_probe,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 1f148fd73935dd00af72f9ecc123065e2f37525d..e3b8028705c213bb1d3106c485ef2124d9afee0f 100644 (file)
@@ -980,4 +980,5 @@ struct flash_driver pic32mx_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = pic32mx_protect_check,
        .info = pic32mx_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index a0240091dc1e99e112c7ed45a5f60daee6d5bad9..47d60dee4267f87ed3c091eb89bf97f5a4fed7ec 100644 (file)
@@ -963,4 +963,5 @@ struct flash_driver psoc4_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = psoc4_protect_check,
        .info = get_psoc4_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 259d6679d82bf7f21343dcc83a05b6ee143a3329..e5c41976423fd71e079110fdc98c6aeeb65de29d 100644 (file)
@@ -982,4 +982,5 @@ struct flash_driver psoc6_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = psoc6_protect_check,
        .info = psoc6_get_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index ce9a21ed5d2517ff1dbb446b681b85f9ae57973d..f282ba0897033c28b50e884c0fa4327be403bf13 100644 (file)
@@ -1122,5 +1122,6 @@ struct flash_driver sim3x_flash = {
        .auto_probe = sim3x_auto_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = sim3x_flash_protect_check,
-       .info = sim3x_flash_info
+       .info = sim3x_flash_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index d28ceee4ba04a5f464850faeadf34b22ebfc254d..79aaf3ba2c6a4ed355a4ac997763efd45a51688d 100644 (file)
@@ -1452,4 +1452,5 @@ struct flash_driver stellaris_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stellaris_protect_check,
        .info = get_stellaris_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index d44670768b6045880205e24464c963525514a578..64c91680c8a5708ec3ebda38e6cda1971225e57e 100644 (file)
@@ -1647,4 +1647,5 @@ struct flash_driver stm32f1x_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stm32x_protect_check,
        .info = get_stm32x_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index b0992b404fe9dc9f9f679ebe593a461e5348119f..8bca62ea207c32030c181e72721f0474e8f338ab 100644 (file)
@@ -1634,4 +1634,5 @@ struct flash_driver stm32f2x_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stm32x_protect_check,
        .info = get_stm32x_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 01e6f06dce2f6f39b180bfbf676ea0d99a6bf2da..a15cd2531ebc8111dd2bfaa6b53d823e603bf98e 100644 (file)
@@ -1180,4 +1180,5 @@ struct flash_driver stm32h7x_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stm32x_protect_check,
        .info = stm32x_get_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 6a1fa074e33da7fadc4214205314a4825825dcc3..e2710bd810ed3c95abc8a368ce85e07d5b494e05 100644 (file)
@@ -953,4 +953,5 @@ struct flash_driver stm32l4x_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stm32l4_protect_check,
        .info = get_stm32l4_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index fdfaad4cf7e8102f7593312bf471b39059512129..f4dd686aaeb5aa06b5a3f5fdd36ff2eb606ed4b9 100644 (file)
@@ -965,6 +965,7 @@ struct flash_driver stm32lx_flash = {
                .erase_check = default_flash_blank_check,
                .protect_check = stm32lx_protect_check,
                .info = stm32lx_get_info,
+               .free_driver_priv = default_flash_free_driver_priv,
 };
 
 /* Static methods implementation */
index 781ea3b5b50cf38cee645101ecea22f6583cfb05..c839bf74cb2ef625b28123e9bde58d78caff51be 100644 (file)
@@ -654,4 +654,5 @@ struct flash_driver stmsmi_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stmsmi_protect_check,
        .info = get_stmsmi_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 11179f520d04e075c3eebde3ff0efe8e642f0976..015202a0e98a0660ed53b5fab913a26a60a0819e 100644 (file)
@@ -812,4 +812,5 @@ struct flash_driver str7x_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = str7x_protect_check,
        .info = get_str7x_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 3b7ca2aa7deef424fc5322ce53307e4c4a5fd1b8..37700ce36d9bfb693fcfca15329cf8804dd091ab 100644 (file)
@@ -679,4 +679,5 @@ struct flash_driver str9x_flash = {
        .auto_probe = str9x_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = str9x_protect_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index eb391e8fbffbea9915ead0983a13176e9057d5d6..29e0977bb435ec1cf4eadd02b94b19ae988995b7 100644 (file)
@@ -1207,4 +1207,5 @@ struct flash_driver str9xpec_flash = {
        .auto_probe = str9xpec_probe,
        .erase_check = str9xpec_erase_check,
        .protect_check = str9xpec_protect_check,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index a70891e898ca3975913b65a63eeeb9f740b8d1b5..102bf1b15090944af0da86871eb241b09ee1ff13 100644 (file)
@@ -1186,4 +1186,5 @@ struct flash_driver tms470_flash = {
        .erase_check = tms470_erase_check,
        .protect_check = tms470_protect_check,
        .info = get_tms470_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 06981f4f4b762df21458777a01e3b82427146c5a..d5d688b36f718ee7b4b4c9952a1609932097a276 100644 (file)
@@ -231,4 +231,5 @@ struct flash_driver virtual_flash = {
        .erase_check = virtual_blank_check,
        .protect_check = virtual_protect_check,
        .info = virtual_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 035791eb3dc64787ae167b623e4ce6b808135887..bc4b1be5edbeaf80379f8b1c5d97bf7197b40b2b 100644 (file)
@@ -636,6 +636,7 @@ static int xcf_probe(struct flash_bank *bank)
        fill_sector_table(bank);
 
        priv->probed = true;
+       /* REVISIT: Why is unchanged bank->driver_priv rewritten by same value? */
        bank->driver_priv = priv;
 
        LOG_INFO("product name: %s", product_name(bank));
@@ -893,5 +894,6 @@ struct flash_driver xcf_flash = {
        .auto_probe         = xcf_auto_probe,
        .erase_check        = xcf_erase_check,
        .protect_check      = xcf_protect_check,
-       .info               = xcf_info
+       .info               = xcf_info,
+       .free_driver_priv   = default_flash_free_driver_priv,
 };
index 0a76b216d4c6e6124a50bb429ea65482c8002a79..4b25398bc261fe5c20f44923ca038011413e8390 100644 (file)
@@ -546,4 +546,5 @@ struct flash_driver xmc1xxx_flash = {
        .erase = xmc1xxx_erase,
        .erase_check = xmc1xxx_erase_check,
        .write = xmc1xxx_write,
+       .free_driver_priv = default_flash_free_driver_priv,
 };
index 5677ef0f1634a7c2d853ea79942a63ab088d8a8d..0b6d48c1bf95b77d6a046e998f59370ea1f504b0 100644 (file)
@@ -1356,4 +1356,5 @@ struct flash_driver xmc4xxx_flash = {
        .info = xmc4xxx_get_info_command,
        .protect_check = xmc4xxx_protect_check,
        .protect = xmc4xxx_protect,
+       .free_driver_priv = default_flash_free_driver_priv,
 };