public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI / LPSS: Make condition local to lpt_register_clock_device
@ 2013-03-20 12:14 Andy Shevchenko
  2013-03-20 12:14 ` [PATCH 2/2] ACPI / LPSS: make code less confusing for reader Andy Shevchenko
  2013-03-26 13:37 ` [PATCH 1/2] ACPI / LPSS: Make condition local to lpt_register_clock_device Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2013-03-20 12:14 UTC (permalink / raw)
  To: linux-acpi, Rafael J. Wysocki, Mika Westerberg; +Cc: Andy Shevchenko

It seems more logical to have the check of lpss_clk_dev variable in
lpt_register_clock_device() because last one actually assignes the variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/acpi_lpss.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index c87db0e..c695841 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -84,6 +84,9 @@ static struct platform_device *lpss_clk_dev;
 
 static inline void lpt_register_clock_device(void)
 {
+	if (lpss_clk_dev)
+		return;
+
 	lpss_clk_dev = platform_device_register_simple("clk-lpt", -1, NULL, 0);
 }
 
@@ -92,8 +95,7 @@ static int register_device_clock(struct acpi_device *adev,
 {
 	const struct lpss_device_desc *dev_desc = pdata->dev_desc;
 
-	if (!lpss_clk_dev)
-		lpt_register_clock_device();
+	lpt_register_clock_device();
 
 	if (!dev_desc->clk_parent || !pdata->mmio_base
 	    || pdata->mmio_size < dev_desc->prv_offset + LPSS_CLK_SIZE)
-- 
1.8.2.rc0.22.gb3600c3


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

end of thread, other threads:[~2013-03-26 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 12:14 [PATCH 1/2] ACPI / LPSS: Make condition local to lpt_register_clock_device Andy Shevchenko
2013-03-20 12:14 ` [PATCH 2/2] ACPI / LPSS: make code less confusing for reader Andy Shevchenko
2013-03-26 13:36   ` Rafael J. Wysocki
2013-03-26 13:37 ` [PATCH 1/2] ACPI / LPSS: Make condition local to lpt_register_clock_device Rafael J. Wysocki

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