mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	jon.nettleton@gmail.com, dsd@laptop.org, jfrederich@gmail.com,
	Murilo Opsfelder Araujo <mopsfelder@gmail.com>
Subject: [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least()
Date: Thu, 15 Jan 2015 23:54:59 -0200	[thread overview]
Message-ID: <1421373300-13672-2-git-send-email-mopsfelder@gmail.com> (raw)
In-Reply-To: <1421373300-13672-1-git-send-email-mopsfelder@gmail.com>

The following error messages are thrown by sparse when CONFIG_OLPC is
not defined:

drivers/staging/olpc_dcon/olpc_dcon.c:147:17: error: undefined identifier 'olpc_board_at_least'
drivers/staging/olpc_dcon/olpc_dcon.c:208:14: error: undefined identifier 'olpc_board_at_least'

This patch fixes these errors.

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
 drivers/staging/olpc_dcon/olpc_dcon.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 6a9a881..3708f1e 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -144,7 +144,9 @@ power_up:
 	}
 	if (x < 0) {
 		pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n");
+#ifdef CONFIG_OLPC
 		BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
+#endif
 		pm = 0;
 		olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
 		msleep(100);
@@ -205,8 +207,10 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
 	if (dcon->asleep == sleep)
 		return;
 
+#ifdef CONFIG_OLPC
 	if (!olpc_board_at_least(olpc_board(0xc2)))
 		return;
+#endif
 
 	if (sleep) {
 		u8 pm = 0;
@@ -795,11 +799,14 @@ struct i2c_driver dcon_driver = {
 
 static int __init olpc_dcon_init(void)
 {
+#ifdef CONFIG_OLPC
 #ifdef CONFIG_FB_OLPC_DCON_1_5
 	/* XO-1.5 */
 	if (olpc_board_at_least(olpc_board(0xd0)))
 		pdata = &dcon_pdata_xo_1_5;
 #endif
+#endif
+
 #ifdef CONFIG_FB_OLPC_DCON_1
 	if (!pdata)
 		pdata = &dcon_pdata_xo_1;
-- 
2.1.0


  reply	other threads:[~2015-01-16  1:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16  1:54 [PATCH 0/2] staging: olpc_dcon: fix sparse warnings and compile errors Murilo Opsfelder Araujo
2015-01-16  1:54 ` Murilo Opsfelder Araujo [this message]
2015-01-16 10:20   ` [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least() Dan Carpenter
2015-01-16  1:55 ` [PATCH 2/2] staging: olpc_dcon: fix sparse symbol not declared warning Murilo Opsfelder Araujo

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=1421373300-13672-2-git-send-email-mopsfelder@gmail.com \
    --to=mopsfelder@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dsd@laptop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jfrederich@gmail.com \
    --cc=jon.nettleton@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome