27 Sep, 2013

7 commits

  • …t/chanwoo/extcon into char-misc-next

    Chanwoo writes:

    Update extcon for 3.13

    This patchset modify extcon core to remove unnecessary allocation sequence for
    'dev' instance and change extcon_dev_register() interface. extcon-gpio use
    gpiolib API to get debounce time and include small fix of extcon core/device
    driver.

    Detailed description for patchset:
    1. Modify extcon core driver
    - The extcon-gpio driver use gpio_set_debounce() API provided from gpiolib
    if gpio driver for SoC support gpio_set_debounce() function and support 'gpio_
    activ_low' filed to check whether gpio active state is 1(high) or 0(low).
    - Change field type of 'dev' in structure extcon_dev and remove the sequence
    of allocating memory of 'struct dev' on extcon_dev_register() function because
    extcon device must need 'struct device.
    - Change extcon_dev_register() prototype to simplify it and remove unnecessary
    parameter as below:

    2. Fix coding style and typo
    - extcon core : Fix indentation coding style and remove unnecessary casting
    - extcon-max8997 : Fix checkpatch warning
    - extcon-max77693 : Fix checkpatch warning
    - extcon-arizona : Fix typo of comment and modify minor issue
    - extcon-palmas : Use dev_get_platdata()

    3. Modify extcon-arizona driver
    - Modify minor issue about micbias and comparision statement

    Greg Kroah-Hartman
     
  • This patch remove extcon_dev_register()'s second parameter which means
    the pointer of parent device to simplify prototype of this function.
    So, if extcon device has the parent device, it should set the pointer of
    parent device to edev.dev.parent in extcon device driver instead of in
    extcon_dev_register().

    Cc: Graeme Gregory
    Cc: Kishon Vijay Abraham I
    Cc: Charles Keepax
    Cc: Mark Brown
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham

    Chanwoo Choi
     
  • The extcon device must always need 'struct device' so this patch change
    field type of 'dev' instead of allocating memory for 'struct device' on
    extcon_dev_register() function.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham

    Chanwoo Choi
     
  • Casting the return value which is a void pointer is redundant.
    The conversion from void pointer to any other pointer type is
    guaranteed by the C programming language.

    Signed-off-by: Jingoo Han
    Signed-off-by: Chanwoo Choi

    Jingoo Han
     
  • Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham

    Chanwoo Choi
     
  • This patch remove unnecessary extern declaration (extcon_set_state).
    checkpatch found this coding style issue.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Greg Kroah-Hartman

    Chanwoo Choi
     
  • This patch fix 80 column coding sytle issues by using checkpatch script.

    Cc: Charles Keepax
    Cc: Mark Brown
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Greg Kroah-Hartman

    Chanwoo Choi
     

04 Sep, 2013

1 commit

  • Pull driver core patches from Greg KH:
    "Here's the big driver core pull request for 3.12-rc1.

    Lots of tiny changes here fixing up the way sysfs attributes are
    created, to try to make drivers simpler, and fix a whole class race
    conditions with creations of device attributes after the device was
    announced to userspace.

    All the various pieces are acked by the different subsystem
    maintainers"

    * tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (119 commits)
    firmware loader: fix pending_fw_head list corruption
    drivers/base/memory.c: introduce help macro to_memory_block
    dynamic debug: line queries failing due to uninitialized local variable
    sysfs: sysfs_create_groups returns a value.
    debugfs: provide debugfs_create_x64() when disabled
    rbd: convert bus code to use bus_groups
    firmware: dcdbas: use binary attribute groups
    sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
    driver core: add #include to core files.
    HID: convert bus code to use dev_groups
    Input: serio: convert bus code to use drv_groups
    Input: gameport: convert bus code to use drv_groups
    driver core: firmware: use __ATTR_RW()
    driver core: core: use DEVICE_ATTR_RO
    driver core: bus: use DRIVER_ATTR_WO()
    driver core: create write-only attribute macros for devices and drivers
    sysfs: create __ATTR_WO()
    driver-core: platform: convert bus code to use dev_groups
    workqueue: convert bus code to use dev_groups
    MEI: convert bus code to use dev_groups
    ...

    Linus Torvalds
     

05 Aug, 2013

1 commit


26 Jul, 2013

1 commit


04 Jul, 2013

1 commit

  • 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 Jun, 2013

2 commits

  • Added EXPORT_SYMBOL_GPL() for extcon_register_interest and
    extcon_register_notifier in order to avoid undefined reference
    error when building the consumer modules of extcon as _modules_.

    Signed-off-by: Kishon Vijay Abraham I
    Signed-off-by: Lokesh Vutla
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Greg Kroah-Hartman

    Kishon Vijay Abraham I
     
  • This patch change permission from read/write to only read.
    The specific process in the user-space couldn't change the state
    of cable when cable is attached or detached.
    - /sys/class/extcon/[devine name]/state

    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Greg Kroah-Hartman

    Chanwoo Choi
     

21 Nov, 2012

1 commit


23 Oct, 2012

6 commits

  • There are some scnearios where a driver/framework needs to register
    interest for a particular cable without specifying the extcon device
    name. One such scenario is charger notifications. The platform will
    have charger cabel which will be bound to any extcon device. It's
    not mandatory for the charger driver to know which extcon device
    it should use. This patch enables the support for registering
    interest for a cable just by cable name wihtout specifying the
    extcon device name

    Signed-off-by: Jenny TC
    Signed-off-by: MyungJoo Ham
    Tested-by: Chanwoo Choi

    --
    Kernel-doc comment added by MyungJoo Ham

    Jenny TC
     
  • There was a case where free and list_del can be called twice
    on the same pointer.So fixed it by re-arranging the code and
    removing a function which was not needed.

    Signed-off-by: anish kumar
    Signed-off-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    anish kumar
     
  • Signed-off-by: Axel Lin
    Signed-off-by: Chanwoo Choi

    Axel Lin
     
  • Propagate the value returned from extcon_find_cable_index()
    instead of -ENODEV. For readability, -EINVAL is returned in place of
    the variable.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Chanwoo Choi

    Sachin Kamat
     
  • Since extcon registers this compat link at device registration
    (extcon_dev_register), we should probably remove them at deregistration/cleanup.

    Cc: stable@vger.kernel.org
    Signed-off-by: Peter Huewe
    Signed-off-by: Chanwoo Choi

    Peter Huewe
     
  • If you compile extcon with CONFIG_ANDROID and then load and unload the
    module you get a simple oops as the driver does not unregister its
    compat class and thus cannot register it again.

    Full trace:

    root@(none):~# modprobe extcon_class
    root@(none):~# rmmod extcon_class
    root@(none):~# modprobe extcon_class
    ------------[ cut here ]------------
    WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0xde/0x100()
    sysfs: cannot create duplicate filename '/class/switch'
    Modules linked in: extcon_class(+) [last unloaded: extcon_class]
    Call Trace:
    9f451a00: [] printk+0x0/0xa8
    9f451a18: [] warn_slowpath_common+0x93/0xd0
    9f451a28: [] sysfs_add_one+0xde/0x100
    9f451a50: [] strcat+0x0/0x40
    9f451a68: [] warn_slowpath_fmt+0x9c/0xa0
    9f451a90: [] unblock_signals+0x0/0x84
    9f451ab0: [] warn_slowpath_fmt+0x0/0xa0
    9f451ac0: [] unblock_signals+0x0/0x84
    9f451ae8: [] sysfs_pathname.isra.10+0x57/0x70
    9f451b00: [] strcat+0x0/0x40
    9f451b18: [] sysfs_pathname.isra.10+0x57/0x70
    9f451b48: [] sysfs_add_one+0xde/0x100
    9f451b78: [] create_dir+0x8f/0x100
    9f451bc0: [] extcon_class_init+0x0/0x12 [extcon_class]
    9f451bd8: [] sysfs_create_dir+0xa6/0x1c0
    9f451be8: [] kvasprintf+0x81/0xa0
    9f451bf8: [] kobject_get+0x0/0x50
    9f451c18: [] kobject_add_internal+0x96/0x280
    9f451c60: [] extcon_class_init+0x0/0x12 [extcon_class]
    9f451c78: [] kobject_add+0xd3/0x140
    9f451cc0: [] kobject_add+0x0/0x140
    9f451cd0: [] unblock_signals+0x0/0x84
    9f451cf8: [] set_signals+0x29/0x3f
    9f451d28: [] kmem_cache_alloc+0xe1/0x100
    9f451d78: [] kobject_create_and_add+0x50/0xa0
    9f451da8: [] class_compat_register+0x56/0x80
    9f451dc8: [] create_extcon_class+0x88/0xd0 [extcon_class]
    9f451de8: [] extcon_class_init+0x10/0x12 [extcon_class]
    9f451df8: [] do_one_initcall+0x48/0x1f0
    9f451e20: [] blocking_notifier_call_chain+0x0/0x20
    9f451e30: [] blocking_notifier_call_chain+0x0/0x20
    9f451e58: [] sys_init_module+0xa3/0x280
    9f451e88: [] handle_syscall+0x8d/0x90
    9f451ea8: [] userspace+0x405/0x531
    9f451ee8: [] copy_chunk_to_user+0x0/0x40
    9f451ef8: [] do_op_one_page+0x14d/0x220
    9f451fd8: [] fork_handler+0x95/0xa0

    ---[ end trace dd512cc03fe1c367 ]---
    ------------[ cut here ]------------
    WARNING: at lib/kobject.c:196 kobject_add_internal+0x26e/0x280()
    kobject_add_internal failed for switch with -EEXIST, don't try to
    register things with the same name in the same directory.
    Modules linked in: extcon_class(+) [last unloaded: extcon_class]
    Call Trace:
    9f451ad0: [] printk+0x0/0xa8
    9f451ae8: [] warn_slowpath_common+0x93/0xd0
    9f451af8: [] kobject_add_internal+0x26e/0x280
    9f451b18: [] kobject_put+0x0/0x70
    9f451b20: [] extcon_class_init+0x0/0x12 [extcon_class]
    9f451b38: [] warn_slowpath_fmt+0x9c/0xa0
    9f451b88: [] warn_slowpath_fmt+0x0/0xa0
    9f451bc0: [] extcon_class_init+0x0/0x12 [extcon_class]
    9f451bd8: [] sysfs_create_dir+0xa6/0x1c0
    9f451be8: [] kvasprintf+0x81/0xa0
    9f451bf8: [] kobject_get+0x0/0x50
    9f451c18: [] kobject_add_internal+0x26e/0x280
    9f451c60: [] extcon_class_init+0x0/0x12 [extcon_class]
    9f451c78: [] kobject_add+0xd3/0x140
    9f451cc0: [] kobject_add+0x0/0x140
    9f451cd0: [] unblock_signals+0x0/0x84
    9f451cf8: [] set_signals+0x29/0x3f
    9f451d28: [] kmem_cache_alloc+0xe1/0x100
    9f451d78: [] kobject_create_and_add+0x50/0xa0
    9f451da8: [] class_compat_register+0x56/0x80
    9f451dc8: [] create_extcon_class+0x88/0xd0 [extcon_class]
    9f451de8: [] extcon_class_init+0x10/0x12 [extcon_class]
    9f451df8: [] do_one_initcall+0x48/0x1f0
    9f451e20: [] blocking_notifier_call_chain+0x0/0x20
    9f451e30: [] blocking_notifier_call_chain+0x0/0x20
    9f451e58: [] sys_init_module+0xa3/0x280
    9f451e88: [] handle_syscall+0x8d/0x90
    9f451ea8: [] userspace+0x405/0x531
    9f451ee8: [] copy_chunk_to_user+0x0/0x40
    9f451ef8: [] do_op_one_page+0x14d/0x220
    9f451fd8: [] fork_handler+0x95/0xa0

    ---[ end trace dd512cc03fe1c368 ]---
    kobject_create_and_add: kobject_add error: -17
    ------------[ cut here ]------------
    WARNING: at drivers/extcon/extcon_class.c:545
    create_extcon_class+0xbc/0xd0 [extcon_class]()
    cannot allocate
    Modules linked in: extcon_class(+) [last unloaded: extcon_class]
    Call Trace:
    9f451c80: [] printk+0x0/0xa8
    9f451c98: [] warn_slowpath_common+0x93/0xd0
    9f451ca0: [] unblock_signals+0x0/0x84
    9f451ca8: [] create_extcon_class+0xbc/0xd0 [extcon_class]
    9f451cd0: [] extcon_class_init+0x0/0x12 [extcon_class]
    9f451ce8: [] warn_slowpath_fmt+0x9c/0xa0
    9f451d20: [] unblock_signals+0x0/0x84
    9f451d28: [] warn_slowpath_fmt+0x0/0xa0
    9f451d48: [] set_signals+0x29/0x3f
    9f451d58: [] kobject_put+0x32/0x70
    9f451d78: [] kfree+0xb3/0x100
    9f451da8: [] class_compat_register+0x7a/0x80
    9f451dc8: [] create_extcon_class+0xbc/0xd0 [extcon_class]
    9f451de8: [] extcon_class_init+0x10/0x12 [extcon_class]
    9f451df8: [] do_one_initcall+0x48/0x1f0
    9f451e20: [] blocking_notifier_call_chain+0x0/0x20
    9f451e30: [] blocking_notifier_call_chain+0x0/0x20
    9f451e58: [] sys_init_module+0xa3/0x280
    9f451e88: [] handle_syscall+0x8d/0x90
    9f451ea8: [] userspace+0x405/0x531
    9f451ee8: [] copy_chunk_to_user+0x0/0x40
    9f451ef8: [] do_op_one_page+0x14d/0x220
    9f451fd8: [] fork_handler+0x95/0xa0

    ---[ end trace dd512cc03fe1c369 ]---
    FATAL: Error inserting extcon_class
    (/lib/modules/3.6.0-rc6-00178-g811315f/kernel/drivers/extcon/extcon_class.ko):
    Cannot allocate memory

    This patch fixes this.

    Cc: stable@vger.kernel.org
    Signed-off-by: Peter Huewe
    Signed-off-by: Chanwoo Choi

    Peter Huewe
     

22 Oct, 2012

2 commits


06 Sep, 2012

1 commit


17 Aug, 2012

2 commits