From faa312da9cd0b044bdc84483162c6ee10b9c83c0 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Fri, 29 Aug 2008 04:18:43 +0800 Subject: lcd: allow lcd device to handle mode change events Some LCD panels are capable of different resolutions, and is allowed to change at run-time, so to make "struct lcd_device" to be able to handle mode change events here. Signed-off-by: Eric Miao Acked-by: Krzysztof Helt Signed-off-by: Russell King --- drivers/video/fbmem.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video/fbmem.c') diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 98843c2ecf73..0737570030f5 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -979,6 +979,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) info->flags &= ~FBINFO_MISC_USEREVENT; event.info = info; + event.data = &mode; fb_notifier_call_chain(evnt, &event); } } -- cgit v1.2.3 From a65e5d782f9db2a61a914dc01a329e0c2dcf92a1 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 9 Jul 2008 10:28:38 +0200 Subject: remove CONFIG_KMOD from drivers Straight forward conversions to CONFIG_MODULE; many drivers include conditionally and then don't have any other conditional code so remove it from those. Signed-off-by: Johannes Berg Cc: video4linux-list@redhat.com Cc: David Woodhouse Cc: linux-ppp@vger.kernel.org Cc: dm-devel@redhat.com Signed-off-by: Rusty Russell --- drivers/md/md.c | 7 ------- drivers/media/video/cpia.c | 4 ---- drivers/media/video/usbvision/usbvision-core.c | 4 ---- drivers/media/video/usbvision/usbvision-video.c | 4 ---- drivers/media/video/v4l1-compat.c | 4 ---- drivers/media/video/v4l2-common.c | 4 ---- drivers/media/video/vino.c | 5 +---- drivers/media/video/w9968cf.c | 4 ++-- drivers/mtd/mtdpart.c | 2 -- drivers/net/irda/sir_dongle.c | 2 -- drivers/net/ppp_generic.c | 10 +++------- drivers/net/pppox.c | 9 ++------- drivers/video/fbmem.c | 17 ++--------------- 13 files changed, 10 insertions(+), 66 deletions(-) (limited to 'drivers/video/fbmem.c') diff --git a/drivers/md/md.c b/drivers/md/md.c index 0a3a4bdcd4af..3323d7647b48 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -44,14 +44,9 @@ #include #include #include - #include - #include - -#ifdef CONFIG_KMOD #include -#endif #include @@ -3555,12 +3550,10 @@ static int do_md_run(mddev_t * mddev) } } -#ifdef CONFIG_KMOD if (mddev->level != LEVEL_NONE) request_module("md-level-%d", mddev->level); else if (mddev->clevel[0]) request_module("md-%s", mddev->clevel); -#endif /* * Drop all container device buffers, from now on diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index c325e926de8a..1798b779a25a 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -39,10 +39,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif - #include "cpia.h" static int video_nr = -1; diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index b26b563a0b0a..9e4f50639975 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c @@ -45,10 +45,6 @@ #include -#ifdef CONFIG_KMOD -#include -#endif - #include "usbvision.h" static unsigned int core_debug; diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index e10b256aeba4..77aeb39b2750 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c @@ -69,10 +69,6 @@ #include -#ifdef CONFIG_KMOD -#include -#endif - #include "usbvision.h" #include "usbvision-cards.h" diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 79937d1031fc..928cb4037372 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c @@ -36,10 +36,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif - static unsigned int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "enable debug messages"); diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 20c3be8617ea..846763d7349e 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c @@ -60,10 +60,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif - #include MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr"); diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index 8ec57df1904f..1efc5f3462c6 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c @@ -30,10 +30,7 @@ #include #include #include - -#ifdef CONFIG_KMOD #include -#endif #include #include @@ -4634,7 +4631,7 @@ static int __init vino_module_init(void) } vino_init_stage++; -#if defined(CONFIG_KMOD) && defined(MODULE) +#ifdef MODULE request_module("saa7191"); request_module("indycam"); #endif diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c index 11edf79f57be..dcd45dbd82dc 100644 --- a/drivers/media/video/w9968cf.c +++ b/drivers/media/video/w9968cf.c @@ -111,7 +111,7 @@ static int specific_debug = W9968CF_SPECIFIC_DEBUG; static unsigned int param_nv[24]; /* number of values per parameter */ -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES module_param(ovmod_load, bool, 0644); #endif module_param(simcams, ushort, 0644); @@ -144,7 +144,7 @@ module_param(debug, ushort, 0644); module_param(specific_debug, bool, 0644); #endif -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES MODULE_PARM_DESC(ovmod_load, "\n<0|1> Automatic 'ovcamchip' module loading." "\n0 disabled, 1 enabled." diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index edb90b58a9b1..9a06dc93ee0d 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -564,10 +564,8 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types, for ( ; ret <= 0 && *types; types++) { parser = get_partition_parser(*types); -#ifdef CONFIG_KMOD if (!parser && !request_module("%s", *types)) parser = get_partition_parser(*types); -#endif if (!parser) { printk(KERN_NOTICE "%s partition parsing not available\n", *types); diff --git a/drivers/net/irda/sir_dongle.c b/drivers/net/irda/sir_dongle.c index 36030241f7a9..2a9930e6e2af 100644 --- a/drivers/net/irda/sir_dongle.c +++ b/drivers/net/irda/sir_dongle.c @@ -67,9 +67,7 @@ int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type) const struct dongle_driver *drv = NULL; int err = -EINVAL; -#ifdef CONFIG_KMOD request_module("irda-dongle-%d", type); -#endif if (dev->dongle_drv != NULL) return -EBUSY; diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 0ca0fcbb7c01..94818ee3cef5 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -2127,13 +2127,9 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg) || ccp_option[1] < 2 || ccp_option[1] > data.length) goto out; - cp = find_compressor(ccp_option[0]); -#ifdef CONFIG_KMOD - if (!cp) { - request_module("ppp-compress-%d", ccp_option[0]); - cp = find_compressor(ccp_option[0]); - } -#endif /* CONFIG_KMOD */ + cp = try_then_request_module( + find_compressor(ccp_option[0]), + "ppp-compress-%d", ccp_option[0]); if (!cp) goto out; diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index c6898c1fc54d..03aecc97fb45 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c @@ -115,13 +115,8 @@ static int pppox_create(struct net *net, struct socket *sock, int protocol) goto out; rc = -EPROTONOSUPPORT; -#ifdef CONFIG_KMOD - if (!pppox_protos[protocol]) { - char buffer[32]; - sprintf(buffer, "pppox-proto-%d", protocol); - request_module(buffer); - } -#endif + if (!pppox_protos[protocol]) + request_module("pppox-proto-%d", protocol); if (!pppox_protos[protocol] || !try_module_get(pppox_protos[protocol]->owner)) goto out; diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0737570030f5..3f18bb9abad0 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -28,9 +28,7 @@ #include #include #include -#ifdef CONFIG_KMOD #include -#endif #include #include #include @@ -837,13 +835,6 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) return (cnt) ? cnt : err; } -#ifdef CONFIG_KMOD -static void try_to_load(int fb) -{ - request_module("fb%d", fb); -} -#endif /* CONFIG_KMOD */ - int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) { @@ -1086,10 +1077,8 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, return -EINVAL; if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) return -EINVAL; -#ifdef CONFIG_KMOD if (!registered_fb[con2fb.framebuffer]) - try_to_load(con2fb.framebuffer); -#endif /* CONFIG_KMOD */ + request_module("fb%d", con2fb.framebuffer); if (!registered_fb[con2fb.framebuffer]) return -EINVAL; event.info = info; @@ -1327,10 +1316,8 @@ fb_open(struct inode *inode, struct file *file) if (fbidx >= FB_MAX) return -ENODEV; lock_kernel(); -#ifdef CONFIG_KMOD if (!(info = registered_fb[fbidx])) - try_to_load(fbidx); -#endif /* CONFIG_KMOD */ + request_module("fb%d", fbidx); if (!(info = registered_fb[fbidx])) { res = -ENODEV; goto out; -- cgit v1.2.3 From 77997aaadd34510ed73153a4cd60161257a9e289 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Jul 2008 20:03:34 -0700 Subject: device create: video: convert device_create_drvdata to device_create Now that device_create() has been audited, rename things back to the original call to be sane. Signed-off-by: Greg Kroah-Hartman --- drivers/video/console/fbcon.c | 4 ++-- drivers/video/display/display-sysfs.c | 9 +++------ drivers/video/fbmem.c | 5 ++--- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'drivers/video/fbmem.c') diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index da91bb16da8a..0e0ea4215a30 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -3573,8 +3573,8 @@ static int __init fb_console_init(void) acquire_console_sem(); fb_register_client(&fbcon_event_notifier); - fbcon_device = device_create_drvdata(fb_class, NULL, MKDEV(0, 0), - NULL, "fbcon"); + fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL, + "fbcon"); if (IS_ERR(fbcon_device)) { printk(KERN_WARNING "Unable to create device " diff --git a/drivers/video/display/display-sysfs.c b/drivers/video/display/display-sysfs.c index 6ef800bdf482..4830b1bf51e5 100644 --- a/drivers/video/display/display-sysfs.c +++ b/drivers/video/display/display-sysfs.c @@ -153,12 +153,9 @@ struct display_device *display_device_register(struct display_driver *driver, mutex_unlock(&allocated_dsp_lock); if (!ret) { - new_dev->dev = device_create_drvdata(display_class, - parent, - MKDEV(0,0), - new_dev, - "display%d", - new_dev->idx); + new_dev->dev = device_create(display_class, parent, + MKDEV(0, 0), new_dev, + "display%d", new_dev->idx); if (!IS_ERR(new_dev->dev)) { new_dev->parent = parent; new_dev->driver = driver; diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0737570030f5..61b36ca06997 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1443,9 +1443,8 @@ register_framebuffer(struct fb_info *fb_info) break; fb_info->node = i; - fb_info->dev = device_create_drvdata(fb_class, fb_info->device, - MKDEV(FB_MAJOR, i), NULL, - "fb%d", i); + fb_info->dev = device_create(fb_class, fb_info->device, + MKDEV(FB_MAJOR, i), NULL, "fb%d", i); if (IS_ERR(fb_info->dev)) { /* Not fatal */ printk(KERN_WARNING "Unable to create device for framebuffer %d; errno = %ld\n", i, PTR_ERR(fb_info->dev)); -- cgit v1.2.3