mfd: cs5535-mfd: Remove ifdef OLPC noise
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 20 Jun 2019 11:19:57 +0000 (13:19 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 2 Jul 2019 11:11:31 +0000 (12:11 +0100)
<asm/olpc.h> provides machine_is_olpc() stub for CONFIG_OLPC=n,
compiler should just optimize the unneeded bits away.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/cs5535-mfd.c

index f9d277ff4aaf117dde859be64d75fce36004b2d7..2e77b6147baa67581e926547b1c8d8e11a6d0784 100644 (file)
@@ -112,22 +112,10 @@ static struct mfd_cell cs5535_mfd_cells[] = {
        },
 };
 
-#ifdef CONFIG_OLPC
-static void cs5535_clone_olpc_cells(void)
-{
-       static const char *acpi_clones[] = {
-               "olpc-xo1-pm-acpi",
-               "olpc-xo1-sci-acpi"
-       };
-
-       if (!machine_is_olpc())
-               return;
-
-       mfd_clone_cell("cs5535-acpi", acpi_clones, ARRAY_SIZE(acpi_clones));
-}
-#else
-static void cs5535_clone_olpc_cells(void) { }
-#endif
+static const char *olpc_acpi_clones[] = {
+       "olpc-xo1-pm-acpi",
+       "olpc-xo1-sci-acpi"
+};
 
 static int cs5535_mfd_probe(struct pci_dev *pdev,
                const struct pci_device_id *id)
@@ -157,7 +145,9 @@ static int cs5535_mfd_probe(struct pci_dev *pdev,
                dev_err(&pdev->dev, "MFD add devices failed: %d\n", err);
                goto err_disable;
        }
-       cs5535_clone_olpc_cells();
+
+       if (machine_is_olpc())
+               mfd_clone_cell("cs5535-acpi", olpc_acpi_clones, ARRAY_SIZE(olpc_acpi_clones));
 
        dev_info(&pdev->dev, "%zu devices registered.\n",
                        ARRAY_SIZE(cs5535_mfd_cells));