public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-acpi@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH 1/2] ACPI / LPSS: Make condition local to lpt_register_clock_device
Date: Wed, 20 Mar 2013 14:14:29 +0200	[thread overview]
Message-ID: <1363781670-28775-1-git-send-email-andriy.shevchenko@linux.intel.com> (raw)

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


             reply	other threads:[~2013-03-20 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 12:14 Andy Shevchenko [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363781670-28775-1-git-send-email-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox