diff --git a/drivers/video/fb.c b/drivers/video/fb.c index d885570..ae6ff74 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -125,6 +125,7 @@ sprintf(dev->name, "fb"); + 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"); @@ -160,19 +161,41 @@ printf("\n"); } -static int fb_probe(struct device_d *hw_dev) +static struct driver_d fb_driver = { + .name = "fb", + .info = fb_info, +}; + +static int fb_match(struct device_d *dev, struct driver_d *drv) { return 0; } -static struct driver_d fb_driver = { - .name = "fb", +static int fb_probe(struct device_d *dev) +{ + return 0; +} + +static void fb_remove(struct device_d *dev) +{ +} + +struct bus_type fb_bus = { + .name = "fb", + .match = fb_match, .probe = fb_probe, - .info = fb_info, + .remove = fb_remove, }; +static int fb_bus_init(void) +{ + return bus_register(&fb_bus); +} +pure_initcall(fb_bus_init); + static int fb_init_driver(void) { + fb_driver.bus = &fb_bus; register_driver(&fb_driver); return 0; } diff --git a/include/fb.h b/include/fb.h index 41deb8c..c594418 100644 --- a/include/fb.h +++ b/include/fb.h @@ -110,5 +110,7 @@ #define FBIO_ENABLE _IO('F', 2) #define FBIO_DISABLE _IO('F', 3) +extern struct bus_type fb_bus; + #endif /* __FB_H */