aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 19:02:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 19:02:13 -0400
commit5d4e2d08e7fdf7339f84a1c670d296a77e02f881 (patch)
tree1c419660defa56191091dfdf50fdb57a72009173 /drivers/char
parentfb2123fad3b499f0898835b19dbb93b18d27ee98 (diff)
parent94ca629e40eb7e997be21d8065c25e4f3797b03f (diff)
Merge tag 'driver-core-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg Kroah-Hartman: "Here's the driver core, and other driver subsystems, pull request for the 3.5-rc1 merge window. Outside of a few minor driver core changes, we ended up with the following different subsystem and core changes as well, due to interdependancies on the driver core: - hyperv driver updates - drivers/memory being created and some drivers moved into it - extcon driver subsystem created out of the old Android staging switch driver code - dynamic debug updates - printk rework, and /dev/kmsg changes All of this has been tested in the linux-next releases for a few weeks with no reported problems. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up conflicts in drivers/extcon/extcon-max8997.c where git noticed that a patch to the deleted drivers/misc/max8997-muic.c driver needs to be applied to this one. * tag 'driver-core-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (90 commits) uio_pdrv_genirq: get irq through platform resource if not set otherwise memory: tegra{20,30}-mc: Remove empty *_remove() printk() - isolate KERN_CONT users from ordinary complete lines sysfs: get rid of some lockdep false positives Drivers: hv: util: Properly handle version negotiations. Drivers: hv: Get rid of an unnecessary check in vmbus_prep_negotiate_resp() memory: tegra{20,30}-mc: Use dev_err_ratelimited() driver core: Add dev_*_ratelimited() family Driver Core: don't oops with unregistered driver in driver_find_device() printk() - restore prefix/timestamp printing for multi-newline strings printk: add stub for prepend_timestamp() ARM: tegra30: Make MC optional in Kconfig ARM: tegra20: Make MC optional in Kconfig ARM: tegra30: MC: Remove unnecessary BUG*() ARM: tegra20: MC: Remove unnecessary BUG*() printk: correctly align __log_buf ARM: tegra30: Add Tegra Memory Controller(MC) driver ARM: tegra20: Add Tegra Memory Controller(MC) driver printk() - restore timestamp printing at console output printk() - do not merge continuation lines of different threads ...
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/mem.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index d6e9d081c8b1..67c3371723cc 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -807,44 +807,6 @@ static const struct file_operations oldmem_fops = {
807}; 807};
808#endif 808#endif
809 809
810static ssize_t kmsg_writev(struct kiocb *iocb, const struct iovec *iv,
811 unsigned long count, loff_t pos)
812{
813 char *line, *p;
814 int i;
815 ssize_t ret = -EFAULT;
816 size_t len = iov_length(iv, count);
817
818 line = kmalloc(len + 1, GFP_KERNEL);
819 if (line == NULL)
820 return -ENOMEM;
821
822 /*
823 * copy all vectors into a single string, to ensure we do
824 * not interleave our log line with other printk calls
825 */
826 p = line;
827 for (i = 0; i < count; i++) {
828 if (copy_from_user(p, iv[i].iov_base, iv[i].iov_len))
829 goto out;
830 p += iv[i].iov_len;
831 }
832 p[0] = '\0';
833
834 ret = printk("%s", line);
835 /* printk can add a prefix */
836 if (ret > len)
837 ret = len;
838out:
839 kfree(line);
840 return ret;
841}
842
843static const struct file_operations kmsg_fops = {
844 .aio_write = kmsg_writev,
845 .llseek = noop_llseek,
846};
847
848static const struct memdev { 810static const struct memdev {
849 const char *name; 811 const char *name;
850 umode_t mode; 812 umode_t mode;
@@ -863,7 +825,9 @@ static const struct memdev {
863 [7] = { "full", 0666, &full_fops, NULL }, 825 [7] = { "full", 0666, &full_fops, NULL },
864 [8] = { "random", 0666, &random_fops, NULL }, 826 [8] = { "random", 0666, &random_fops, NULL },
865 [9] = { "urandom", 0666, &urandom_fops, NULL }, 827 [9] = { "urandom", 0666, &urandom_fops, NULL },
866 [11] = { "kmsg", 0, &kmsg_fops, NULL }, 828#ifdef CONFIG_PRINTK
829 [11] = { "kmsg", 0644, &kmsg_fops, NULL },
830#endif
867#ifdef CONFIG_CRASH_DUMP 831#ifdef CONFIG_CRASH_DUMP
868 [12] = { "oldmem", 0, &oldmem_fops, NULL }, 832 [12] = { "oldmem", 0, &oldmem_fops, NULL },
869#endif 833#endif