mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] fb: move add param to bus probe
Date: Tue, 25 Sep 2012 15:25:07 +0200	[thread overview]
Message-ID: <1348579509-8255-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20120925132132.GM26553@game.jcrosoft.org>

so the param add added only of the device successed to register.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/video/fb.c |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index ae6ff74..ee53272 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -127,16 +127,6 @@ int register_framebuffer(struct fb_info *info)
 
 	info->dev.bus = &fb_bus;
 	register_device(&info->dev);
-	dev_add_param(dev, "enable", fb_enable_set, NULL, 0);
-	dev_set_param(dev, "enable", "0");
-
-	if (info->num_modes && (info->mode_list != NULL) &&
-			(info->fbops->fb_activate_var != NULL)) {
-		dev_add_param(dev, "mode_name", fb_setup_mode, NULL, 0);
-		dev_set_param(dev, "mode_name", info->mode_list[0].name);
-	}
-
-	devfs_create(&info->cdev);
 
 	return 0;
 }
@@ -173,7 +163,18 @@ static int fb_match(struct device_d *dev, struct driver_d *drv)
 
 static int fb_probe(struct device_d *dev)
 {
-	return 0;
+	struct fb_info *info = dev->priv;
+
+	dev_add_param(dev, "enable", fb_enable_set, NULL, 0);
+	dev_set_param(dev, "enable", "0");
+
+	if (info->num_modes && (info->mode_list != NULL) &&
+			(info->fbops->fb_activate_var != NULL)) {
+		dev_add_param(dev, "mode_name", fb_setup_mode, NULL, 0);
+		dev_set_param(dev, "mode_name", info->mode_list[0].name);
+	}
+
+	return devfs_create(&info->cdev);
 }
 
 static void fb_remove(struct device_d *dev)
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-09-25 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25 13:21 [PATCH 0/3] final bus cleanup Jean-Christophe PLAGNIOL-VILLARD
2012-09-25 13:25 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-09-25 13:25   ` [PATCH 2/3] switch all platform_bus device/driver registering to platform_driver/device_register Jean-Christophe PLAGNIOL-VILLARD
2012-09-25 13:25   ` [PATCH 3/3] devinfo: display device bus name Jean-Christophe PLAGNIOL-VILLARD
2012-09-26  7:51 ` [PATCH 0/3] final bus cleanup Sascha Hauer

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=1348579509-8255-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.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