31 Jan, 2014

1 commit

  • Currently we kfree the container of the device which failed to register.
    This is wrong as the last reference is not given up with a put_device
    call. Also, now that we have put_device() callen, we no longer need the
    kfree as the new_ld->dev.release function will take care of kfreeing the
    associated memory.

    Signed-off-by: Levente Kurusa
    Acked-by: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Levente Kurusa
     

26 Jul, 2013

1 commit


04 Jul, 2013

2 commits

  • These functions allow the driver core to automatically clean up any
    allocation made by lcd drivers. Thus it simplifies the error paths.

    Signed-off-by: Jingoo Han
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Calling dev_set_name with a single paramter causes it to be handled as a
    format string. Many callers are passing potentially dynamic string
    content, so use "%s" in those cases to avoid any potential accidents,
    including wrappers like device_create*() and bdi_register().

    Signed-off-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

18 Dec, 2012

1 commit


30 May, 2012

2 commits

  • Use pr_warn() and pr_debug() instead of printk to allow dynamic debugging.
    The pr_fmt prefix for pr_ macros is used. Also fix checkpatch warnings
    as below:

    WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • This patchset adds early fb blank feature that a callback of lcd panel
    driver is called prior to specific fb driver's one. In the case of
    MIPI-DSI based video mode LCD Panel, for lcd power off, the power off
    commands should be transferred to lcd panel with display and mipi-dsi
    controller enabled because the commands is set to lcd panel at vsync porch
    period. and in opposite case, the callback of fb driver should be called
    prior to lcd panel driver's one because of same issue. Also if fb_blank
    mode is changed to FB_BLANK_POWERDOWN then display controller would be
    off(clock disable) but lcd panel would be still on. at this time, you
    could see some issue like sparkling on lcd panel because video clock to be
    delivered to ldi module of lcd panel was disabled. this issue could
    occurs for all lcd panels.

    The callback order is as the following:

    at fb_blank function of fbmem.c
    -> fb_notifier_call_chain(FB_EARLY_EVENT_BLANK)
    -> lcd panel driver's early_set_power()
    -> info->fbops->fb_blank()
    -> spcefic fb driver's fb_blank()
    -> fb_notifier_call_chain(FB_EVENT_BLANK)
    -> lcd panel driver's set_power()
    -> fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK) if
    info->fops->fb_blank() was failed.

    fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK) would be called to revert
    the effects of previous FB_EARLY_EVENT_BLANK call. and note that if
    early_set_power() of lcd_ops is NULL then early fb blank callback would be
    ignored.

    This patch:

    Add early_set_power and r_early_set_power callbacks. early_set_power
    callback is called prior to fb_blank() of fbmem.c and r_early_set_power
    callback is called if fb_blank() was failed to revert the effects of the
    early_set_power call of lcd panel driver.

    Signed-off-by: Inki Dae
    Signed-off-by: Kyungmin Park
    Cc: Lars-Peter Clausen
    Cc: Florian Tobias Schandinat
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Inki Dae
     

11 Jan, 2012

1 commit

  • The usage of simple_strtoul() or strict_strtoul() is not preferred. Thus,
    kstrtoul should be used.

    This patch also fixes checkpatch error as follows:
    ERROR: space required after that ',' (ctx:VxV)

    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     

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
     

16 Dec, 2009

1 commit

  • Makes use of skip_spaces() defined in lib/string.c for removing leading
    spaces from strings all over the tree.

    It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
    text data bss dec hex filename
    64688 584 592 65864 10148 (TOTALS-BEFORE)
    64641 584 592 65817 10119 (TOTALS-AFTER)

    Also, while at it, if we see (*str && isspace(*str)), we can be sure to
    remove the first condition (*str) as the second one (isspace(*str)) also
    evaluates to 0 whenever *str == 0, making it redundant. In other words,
    "a char equals zero is never a space".

    Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
    and found occurrences of this pattern on 3 more files:
    drivers/leds/led-class.c
    drivers/leds/ledtrig-timer.c
    drivers/video/output.c

    @@
    expression str;
    @@

    ( // ignore skip_spaces cases
    while (*str && isspace(*str)) { \(str++;\|++str;\) }
    |
    - *str &&
    isspace(*str)
    )

    Signed-off-by: André Goddard Rosa
    Cc: Julia Lawall
    Cc: Martin Schwidefsky
    Cc: Jeff Dike
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Richard Purdie
    Cc: Neil Brown
    Cc: Kyle McMartin
    Cc: Henrique de Moraes Holschuh
    Cc: David Howells
    Cc:
    Cc: Samuel Ortiz
    Cc: Patrick McHardy
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     

16 Nov, 2009

1 commit


14 Apr, 2009

1 commit

  • fb_notifier_call_chain() is called with info->lock held, i.e. in
    do_fb_ioctl() => FBIOPUT_VSCREENINFO => fb_set_var() and the some
    notifier callbacks, like fbcon_event_notify(), try to re-acquire
    info->lock again.

    Remove the lock/unlock_fb_info() in all the framebuffer notifier
    callbacks' and be sure to always call fb_notifier_call_chain() with
    info->lock held.

    Reported-by: Pavel Roskin
    Reported-by: Eric Miao
    Signed-off-by: Andrea Righi
    Cc: Stefan Richter
    Cc: Krzysztof Helt
    Cc: Geert Uytterhoeven
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Righi
     

01 Apr, 2009

1 commit

  • Fix a circular locking dependency in the frame buffer console driver
    pushing down the mutex fb_info->lock.

    Circular locking dependecies occur calling the blocking
    fb_notifier_call_chain() with fb_info->lock held. Notifier callbacks can
    try to acquire mm->mmap_sem, while fb_mmap() acquires the locks in the
    reverse order mm->mmap_sem => fb_info->lock.

    Tested-by: Andrey Borzenkov
    Signed-off-by: Andrea Righi
    Cc: Geert Uytterhoeven
    Cc: Krzysztof Helt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Righi
     

07 Jan, 2009

1 commit


20 Nov, 2008

1 commit

  • The LCD driver core calls LCD drivers when either the blanking state or
    the display mode has changed, but does not make any check to see if the
    called driver has a .set_mode method.

    This means if a driver only has a .set_power method then the system will
    OOPS on changing mode (and with the console semaphore held so you cannot
    easily see the problem).

    Fix the problem by ensuring that either callback is valid before use.

    Signed-off-by: Ben Dooks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     

24 Sep, 2008

1 commit


25 Jul, 2008

1 commit

  • Add the lcd_device being checked to the check_fb entry of lcd_ops. This
    ensures that any driver using this to check against it's own state can do
    so, and also makes all the calls in lcd_ops more orthogonal in their
    arguments.

    Signed-off-by: Ben Dooks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     

12 Oct, 2007

1 commit


16 Jul, 2007

1 commit

  • Convert the backlight and LCD classes from struct class_device
    to struct device since class_device is scheduled for removal.

    One nasty API break is the backlight power attribute has had to be
    renamed to bl_power and the LCD power attribute has had to be renamed
    to lcd_power since the original names clash with the core. I can't see
    a way around this.

    Signed-off-by: Richard Purdie
    Acked-by: Greg Kroah-Hartman

    Richard Purdie
     

12 Jul, 2007

1 commit

  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

20 Feb, 2007

5 commits


09 Dec, 2006

2 commits


16 May, 2006

1 commit


10 Mar, 2006

1 commit


08 Feb, 2006

1 commit


09 Nov, 2005

1 commit

  • This patch removes almost all inclusions of linux/version.h. The 3
    #defines are unused in most of the touched files.

    A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is
    unfortunatly in linux/version.h.

    There are also lots of #ifdef for long obsolete kernels, this was not
    touched. In a few places, the linux/version.h include was move to where
    the LINUX_VERSION_CODE was used.

    quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'`

    search pattern:
    /UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h

    Signed-off-by: Olaf Hering
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds