OSDN Git Service

ata_piix: remove open-coded dmi_match(DMI_OEM_STRING)
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Thu, 7 Nov 2019 03:32:53 +0000 (04:32 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 7 Nov 2019 03:34:25 +0000 (20:34 -0700)
Since de40614de99 ("firmware: dmi_scan: Add DMI_OEM_STRING support to
dmi_matches") dmi_check_system() can match OEM_STRINGs itself.
Use the feature.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/ata_piix.c

index e4da725..3ca7720 100644 (file)
@@ -841,6 +841,12 @@ static int piix_broken_suspend(void)
                        },
                },
                {
+                       .ident = "TECRA M3",
+                       .matches = {
+                               DMI_MATCH(DMI_OEM_STRING, "Tecra M3,"),
+                       },
+               },
+               {
                        .ident = "TECRA M4",
                        .matches = {
                                DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
@@ -955,18 +961,10 @@ static int piix_broken_suspend(void)
 
                { }     /* terminate list */
        };
-       static const char *oemstrs[] = {
-               "Tecra M3,",
-       };
-       int i;
 
        if (dmi_check_system(sysids))
                return 1;
 
-       for (i = 0; i < ARRAY_SIZE(oemstrs); i++)
-               if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL))
-                       return 1;
-
        /* TECRA M4 sometimes forgets its identify and reports bogus
         * DMI information.  As the bogus information is a bit
         * generic, match as many entries as possible.  This manual