Commit 78cde088 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Driver core: convert fb code to use struct device

Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e55c8790
...@@ -1296,14 +1296,14 @@ register_framebuffer(struct fb_info *fb_info) ...@@ -1296,14 +1296,14 @@ register_framebuffer(struct fb_info *fb_info)
break; break;
fb_info->node = i; fb_info->node = i;
fb_info->class_device = class_device_create(fb_class, NULL, MKDEV(FB_MAJOR, i), fb_info->dev = device_create(fb_class, fb_info->device,
fb_info->device, "fb%d", i); MKDEV(FB_MAJOR, i), "fb%d", i);
if (IS_ERR(fb_info->class_device)) { if (IS_ERR(fb_info->dev)) {
/* Not fatal */ /* Not fatal */
printk(KERN_WARNING "Unable to create class_device for framebuffer %d; errno = %ld\n", i, PTR_ERR(fb_info->class_device)); printk(KERN_WARNING "Unable to create device for framebuffer %d; errno = %ld\n", i, PTR_ERR(fb_info->dev));
fb_info->class_device = NULL; fb_info->dev = NULL;
} else } else
fb_init_class_device(fb_info); fb_init_device(fb_info);
if (fb_info->pixmap.addr == NULL) { if (fb_info->pixmap.addr == NULL) {
fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL); fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL);
...@@ -1356,8 +1356,8 @@ unregister_framebuffer(struct fb_info *fb_info) ...@@ -1356,8 +1356,8 @@ unregister_framebuffer(struct fb_info *fb_info)
fb_destroy_modelist(&fb_info->modelist); fb_destroy_modelist(&fb_info->modelist);
registered_fb[i]=NULL; registered_fb[i]=NULL;
num_registered_fb--; num_registered_fb--;
fb_cleanup_class_device(fb_info); fb_cleanup_device(fb_info);
class_device_destroy(fb_class, MKDEV(FB_MAJOR, i)); device_destroy(fb_class, MKDEV(FB_MAJOR, i));
event.info = fb_info; event.info = fb_info;
fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
return 0; return 0;
......
This diff is collapsed.
...@@ -774,8 +774,8 @@ struct fb_info { ...@@ -774,8 +774,8 @@ struct fb_info {
#endif #endif
struct fb_ops *fbops; struct fb_ops *fbops;
struct device *device; struct device *device; /* This is the parent */
struct class_device *class_device; /* sysfs per device attrs */ struct device *dev; /* This is this fb device */
int class_flag; /* private sysfs flags */ int class_flag; /* private sysfs flags */
#ifdef CONFIG_FB_TILEBLITTING #ifdef CONFIG_FB_TILEBLITTING
struct fb_tile_ops *tileops; /* Tile Blitting */ struct fb_tile_ops *tileops; /* Tile Blitting */
...@@ -910,8 +910,8 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, ...@@ -910,8 +910,8 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
/* drivers/video/fbsysfs.c */ /* drivers/video/fbsysfs.c */
extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
extern void framebuffer_release(struct fb_info *info); extern void framebuffer_release(struct fb_info *info);
extern int fb_init_class_device(struct fb_info *fb_info); extern int fb_init_device(struct fb_info *fb_info);
extern void fb_cleanup_class_device(struct fb_info *head); extern void fb_cleanup_device(struct fb_info *head);
extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max);
/* drivers/video/fbmon.c */ /* drivers/video/fbmon.c */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment