[PATCH 1/3] fb: move add param to bus probe
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Tue Sep 25 09:25:07 EDT 2012
so the param add added only of the device successed to register.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at 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
More information about the barebox
mailing list