public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] mfd: cs5535-mfd: remove ifdef OLPC noise
@ 2019-06-20 11:19 Lubomir Rintel
  2019-06-26  9:23 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Lubomir Rintel @ 2019-06-20 11:19 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Lubomir Rintel

<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>
---
 drivers/mfd/cs5535-mfd.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
index 0b49940c490e..f1825c0ccbd0 100644
--- a/drivers/mfd/cs5535-mfd.c
+++ b/drivers/mfd/cs5535-mfd.c
@@ -100,22 +100,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)
@@ -145,7 +133,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));
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] mfd: cs5535-mfd: remove ifdef OLPC noise
  2019-06-20 11:19 [PATCH RESEND] mfd: cs5535-mfd: remove ifdef OLPC noise Lubomir Rintel
@ 2019-06-26  9:23 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2019-06-26  9:23 UTC (permalink / raw)
  To: Lubomir Rintel; +Cc: linux-kernel

On Thu, 20 Jun 2019, Lubomir Rintel wrote:

> <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>
> ---
>  drivers/mfd/cs5535-mfd.c | 24 +++++++-----------------
>  1 file changed, 7 insertions(+), 17 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-26  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20 11:19 [PATCH RESEND] mfd: cs5535-mfd: remove ifdef OLPC noise Lubomir Rintel
2019-06-26  9:23 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox