13 Jan, 2012

1 commit


19 Nov, 2011

1 commit

  • This converts the drivers in drivers/media/* to use the
    module_usb_driver() macro which makes the code smaller and a bit
    simpler.

    Added bonus is that it removes some unneeded kernel log messages about
    drivers loading and/or unloading.

    Cc: Mauro Carvalho Chehab
    Cc: Luca Risolia
    Cc: Jean-Francois Moine
    Cc: Frank Zago
    Cc: Olivier Lorin
    Cc: Erik Andren
    Cc: Hans de Goede
    Cc: Brian Johnson
    Cc: Leandro Costantino
    Cc: Antoine Jacquet
    Cc: Jarod Wilson
    Cc: Florian Mickler
    Cc: Antti Palosaari
    Cc: Michael Krufky
    Cc: "David Härdeman"
    Cc: Florent Audebert
    Cc: Sam Doshi
    Cc: Manu Abraham
    Cc: Olivier Grenie
    Cc: Patrick Boettcher
    Cc: "Igor M. Liplianin"
    Cc: Derek Kelly
    Cc: Malcolm Priestley
    Cc: Steven Toth
    Cc: "André Weidemann"
    Cc: Martin Wilks
    Cc: Tejun Heo
    Cc: Jose Alberto Reguero
    Cc: David Henningsson
    Cc: Paul Gortmaker
    Cc: Joe Perches
    Cc: Jesper Juhl
    Cc: Lucas De Marchi
    Cc: Hans Verkuil
    Cc: Alexey Khoroshilov
    Cc: Anssi Hannula
    Cc: Rafi Rubin
    Cc: Dan Carpenter
    Cc: Paul Bender
    Cc: Devin Heitmueller
    Cc: "Márcio A Alves"
    Cc: Julia Lawall
    Cc: Laurent Pinchart
    Cc: Chris Rankin
    Cc: Lee Jones
    Cc: Andy Walls
    Cc: Andrew Morton
    Cc: Mike Frysinger
    Cc: Dean Anderson
    Cc: Pete Eberlein
    Cc: Arvydas Sidorenko
    Cc: Andrea Anacleto
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

01 Nov, 2011

1 commit


04 Sep, 2011

1 commit

  • Usage of these flags has been deprecated for nearly 4 years by:

    commit f77bf01425b11947eeb3b5b54685212c302741b8
    Author: Sam Ravnborg
    Date: Mon Oct 15 22:25:06 2007 +0200

    kbuild: introduce ccflags-y, asflags-y and ldflags-y

    Moreover, these flags (at least EXTRA_CFLAGS) have been documented for command
    line use. By default, gmake(1) do not override command line setting, so this is
    likely to result in build failure or unexpected behavior.

    Replace their usage by Kbuild's `{as,cc,ld}flags-y'.

    Cc: Sam Ravnborg
    Cc: Mauro Carvalho Chehab
    Cc: linux-media@vger.kernel.org
    Signed-off-by: Arnaud Lacombe
    Acked-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Arnaud Lacombe
     

30 Jul, 2011

1 commit

  • * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits)
    [media] ir-mce_kbd-decoder: include module.h for its facilities
    [media] ov5642: include module.h for its facilities
    [media] em28xx: Fix DVB-C maxsize for em2884
    [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
    [media] v4l: mt9v032: Fix Bayer pattern
    [media] V4L: mt9m111: rewrite set_pixfmt
    [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
    [media] V4L: initial driver for ov5642 CMOS sensor
    [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
    [media] V4L: soc-camera: remove soc-camera bus and devices on it
    [media] V4L: soc-camera: un-export the soc-camera bus
    [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
    [media] V4L: add media bus configuration subdev operations
    [media] V4L: soc-camera: group struct field initialisations together
    [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
    [media] V4L: pxa-camera: switch to using standard PM hooks
    [media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
    [media] Don't OOPS if videobuf_dvb_get_frontend return NULL
    [media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
    [media] omap3isp: Support configurable HS/VS polarities
    ...

    Fix up conflicts:
    - arch/arm/mach-omap2/board-rx51-peripherals.c:
    cleanup regulator supply definitions in mach-omap2
    vs
    OMAP3: RX-51: define vdds_csib regulator supply
    - drivers/staging/tm6000/tm6000-alsa.c (trivial)

    Linus Torvalds
     

28 Jul, 2011

1 commit

  • All the modified drivers didn't have any version increment since
    Jan, 1 2011. Several of them didn't have any version increment
    for a long time, even having new features and important bug fixes
    happening.

    As we're now filling the QUERYCAP version with the current Kernel
    Release, we don't need to maintain a per-driver version control
    anymore. So, let's just use the default.

    In order to preserve the Kernel module version history, a
    KERNEL_VERSION() macro were added to all modified drivers, and
    the extraver number were incremented.

    I opted to preserve the per-driver version control to a few
    pwc, pvrusb2, s2255, s5p-fimc and sh_vou.

    A few drivers are still using the legacy way to handle ioctl's.
    So, we can't do such change on them, otherwise, they'll break.
    Those are: uvc, et61x251 and sn9c102.

    The rationale is that the per-driver version control seems to be
    actively maintained on those.

    Yet, I think that the better for them would be to just use the
    default version numbering, instead of doing that by themselves.

    While here, removed a few uneeded include linux/version.h

    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

23 Mar, 2011

3 commits

  • The hdpvr's IR part, in short, sucks. As observed with a usb traffic
    sniffer, the Windows software for it uses a polling interval of 405ms.
    Its still not behaving as well as I'd like even with this change, but
    this inches us closer and closer to that point...

    Signed-off-by: Jarod Wilson
    Signed-off-by: Mauro Carvalho Chehab

    Jarod Wilson
     
  • The rc-hauppauge-new map is a messy thing, as it bundles 3

    different remote controllers as if they were just one,
    discarding the address byte. Also, some key maps are wrong.

    With the conversion to the new rc-core, it is likely that
    most of the devices won't be working properly, as the i2c
    driver and the raw decoders are now providing 16 bits for
    the remote, instead of just 8.

    delete mode 100644 drivers/media/rc/keymaps/rc-hauppauge-new.c

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jarod Wilson

    Mauro Carvalho Chehab
     
  • Make the hdpvr's i2c master implementation more closely mirror that of
    the pvrusb2 driver. Currently makes no significant difference in IR
    reception behavior with ir-kbd-i2c (i.e., it still sucks).

    Signed-off-by: Jarod Wilson
    Signed-off-by: Mauro Carvalho Chehab

    Jarod Wilson
     

31 Jan, 2011

1 commit


19 Jan, 2011

2 commits

  • The current hdpvr code kmalloc's a new buffer for every i2c read and
    write. Rather than do that, lets allocate a buffer in the driver's
    device struct and just use that every time.

    The size I've chosen for the buffer is the maximum size I could
    ascertain might be used by either ir-kbd-i2c or lirc_zilog, plus a bit
    of padding (lirc_zilog may use up to 100 bytes on tx, rounded that up
    to 128).

    Note that this might also remedy user reports of very sluggish behavior
    of IR receive with hdpvr hardware.

    v2: make sure (len i2c_buf)) [Jean Delvare]

    Reported-by: Jean Delvare
    Acked-by: Jean Delvare
    Signed-off-by: Jarod Wilson
    Signed-off-by: Mauro Carvalho Chehab

    Jarod Wilson
     
  • A number of things going on here, but the end result is that the IR part
    on the hdpvr gets enabled, and can be used with ir-kbd-i2c and/or
    lirc_zilog.

    First up, there are some conditional build fixes that come into play
    whether i2c is built-in or modular. Second, we're swapping out
    i2c_new_probed_device() for i2c_new_device(), as in my testing, probing
    always fails, but we *know* that all hdpvr devices have a z8 chip at
    0x70 and 0x71. Third, we're poking at an i2c address directly without a
    client, and writing some magic bits to actually turn on this IR part
    (this could use some improvement in the future). Fourth, some of the
    i2c_adapter storage has been reworked, as the existing implementation
    used to lead to an oops following i2c changes c. 2.6.31.

    Earlier editions of this patch have been floating around the 'net for a
    while, including being patched into Fedora kernels, and they *do* work.
    This specific version isn't yet tested, beyond loading ir-kbd-i2c and
    confirming that it does bind to the RX address of the hdpvr.

    [mchehab@redhat.com: I2C_CLASS_TV_ANALOG is not defined. Fix compilation bug]
    Signed-off-by: Jarod Wilson
    Acked-by: Andy Walls
    Signed-off-by: Mauro Carvalho Chehab

    Jarod Wilson
     

30 Dec, 2010

1 commit


21 Oct, 2010

10 commits


03 Aug, 2010

2 commits


01 Jun, 2010

1 commit

  • In each case, the print involves dereferencing a value that is NULL or is
    near NULL.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r exists@
    expression E,E1;
    identifier f;
    statement S1,S2,S3;
    @@

    if ((E == NULL && ...) || ...)
    {
    ... when != if (...) S1 else S2
    when != E = E1
    * E->f
    ... when any
    return ...;
    }
    else S3
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     

21 May, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (229 commits)
    USB: remove unused usb_buffer_alloc and usb_buffer_free macros
    usb: musb: update gfp/slab.h includes
    USB: ftdi_sio: fix legacy SIO-device header
    USB: kl5usb105: reimplement using generic framework
    USB: kl5usb105: minor clean ups
    USB: kl5usb105: fix memory leak
    USB: io_ti: use kfifo to implement write buffering
    USB: io_ti: remove unsused private counter
    USB: ti_usb: use kfifo to implement write buffering
    USB: ir-usb: fix incorrect write-buffer length
    USB: aircable: fix incorrect write-buffer length
    USB: safe_serial: straighten out read processing
    USB: safe_serial: reimplement read using generic framework
    USB: safe_serial: reimplement write using generic framework
    usb-storage: always print quirks
    USB: usb-storage: trivial debug improvements
    USB: oti6858: use port write fifo
    USB: oti6858: use kfifo to implement write buffering
    USB: cypress_m8: use kfifo to implement write buffering
    USB: cypress_m8: remove unused drain define
    ...

    Fix up conflicts (due to usb_buffer_alloc/free renaming) in
    drivers/input/tablet/acecad.c
    drivers/input/tablet/kbtab.c
    drivers/input/tablet/wacom_sys.c
    drivers/media/video/gspca/gspca.c
    sound/usb/usbaudio.c

    Linus Torvalds
     
  • For more clearance what the functions actually do,

    usb_buffer_alloc() is renamed to usb_alloc_coherent()
    usb_buffer_free() is renamed to usb_free_coherent()

    They should only be used in code which really needs DMA coherency.

    All call sites have been changed accordingly, except for staging
    drivers.

    Signed-off-by: Daniel Mack
    Cc: Alan Stern
    Cc: Pedro Ribeiro
    Signed-off-by: Greg Kroah-Hartman

    Daniel Mack
     

19 May, 2010

1 commit

  • Disconnecting the HDPVR caused a kernel oops if lockdep was enabled.
    In addition, if an app still had video0 open and attempted to call ioctl
    when the device was already disconnected the system would crash.

    Move the freeing and cleanup code to the release function: that is the
    right place for it since you know when you get there that nobody is
    using the device.

    Also removed usb_set_intfdata: v4l2_device_register sets this already
    to v4l2_dev.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

27 Feb, 2010

4 commits


16 Dec, 2009

3 commits

  • sizeof(print_buf) is just the size of the pointer. Change it to the size
    used in the allocation of print_buf earlier in the same function.

    A simplified version of the semantic patch that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression *x;
    expression f;
    type T;
    @@

    *f(...,(T)x,...)
    //

    Cc: Janne Grunau
    Signed-off-by: Julia Lawall
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     
  • Replace the video_is_unregistered function by a video_is_registered
    function. The V4L2_FL_UNREGISTERED flag is replaced by a
    V4L2_FL_REGISTERED flag.

    This change makes the video_is_registered function return coherent
    results when called on an initialize but not yet registered video_device
    instance. The function can now be used instead of checking
    video_device::minor.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     
  • Fix all device drivers to use the new video_device_node_name function.

    This also strips kernel log messages from the "/dev/" prefix, has the device
    node location is a userspace policy decision unknown to the kernel.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     

06 Dec, 2009

1 commit

  • Error handling code following a kzalloc should free the allocated data.
    Similarly for usb-alloc urb.

    The semantic match that finds the first problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    statement S;
    expression E;
    identifier f,f1,l;
    position p1,p2;
    expression *ptr != NULL;
    @@

    x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
    ...
    if (x == NULL) S
    }
    (
    x->f1 = E
    |
    (x->f1 == NULL || ...)
    |
    f(...,x->f1,...)
    )
    ...>
    (
    return \(0\|\|ptr\);
    |
    return@p2 ...;
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall