Commit graph

34 commits

Author SHA1 Message Date
Michalis Pappas f5439c612e staging: gdm72xx: replace print_hex_dump_debug() with dev_dbg()
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 18:07:30 -07:00
Michalis Pappas 1aa8ae7043 staging: gdm72xx: reorder functions and remove forward declarations
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 21:17:50 -07:00
Ben Chan a8a175d9fc staging: gdm72xx: clean up endianness conversions
This patch cleans up the endianness conversions in the gdm72xx driver:
- Directly use the generic byte-reordering macros for endianness
  conversion instead of some custom-defined macros.
- Convert values on the constant side instead of the variable side when
  appropriate.
- Add endianness annotations.

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 11:49:16 -07:00
Ben Chan 0fbce84c6f staging: gdm72xx: return -EINVAL instead of BUG_ON for invalid data length
This patch changes gdm_usb_send() and gdm_sdio_send() to return -EINVAL instead
of calling BUG_ON if an invalid data length is passed to the functions.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-29 14:41:04 -07:00
Ben Chan 1cd683a814 staging: gdm72xx: remove blank lines after an open brace
This patch fixes the following checkpatch warning:

  CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:36:57 -04:00
Ben Chan e7d374e700 staging: gdm72xx: fix block comment style
This patch fixes the following checkpatch warnings, which are issued
when the gdm72xx driver is moved out of staging into drivers/net/wimax:

  WARNING: networking block comments don't use an empty /* line, use /* Comment...
  WARNING: networking block comments start with * on subsequent lines
  WARNING: networking block comments put the trailing */ on a separate line

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:36:57 -04:00
Davide Gianforte a3709f7a14 staging: gdm72xx: code cleanup
Checkpatch.pl cleanup

Thanks again to Greg KH and Dan Carpenter for the patience :)

Signed-off-by: Davide Gianforte <davide@gengisdave.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 07:23:15 +09:00
Michalis Pappas ac1a3bfafb staging: gdm72xx: Indentation and other whitespace fixes
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16 12:12:52 -07:00
Michalis Pappas 39c511f8cb staging: gdm72xx: Whitespace fixes to conform to coding standards
Fixes the following checkpatch.pl issues:

WARNING: unnecessary whitespace before a quoted newline
CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast

Also some additional, whitespace related, readability issues.

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16 12:12:52 -07:00
Michalis Pappas 522c6ff211 staging: gdm72xx: Move logical continuation to previous line to conform to coding style
Fixes the following checkpatch.pl issue:

CHECK: Logical continuations should be on the previous line

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16 12:12:51 -07:00
Michalis Pappas 917ab47f5a staging: gdm72xx: Replace comparisons on jiffies values with wrap-safe functions
Fixes the following checkpatch.pl issue:

WARNING: Comparing jiffies is almost always wrong; prefer time_after,
time_before and friends

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16 12:12:51 -07:00
Kristina Martšenko 8943a92fc2 staging: gdm72xx: replace printk() and debug macros with dynamic debugging
Replace printk(KERN_DEBUG ...) with netdev_dbg and dev_dbg. Remove
debug macros which become unnecessary.

This removes the following types of checkpatch warnings from the driver:
drivers/staging/gdm72xx/gdm_sdio.c:461: WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...

Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 19:53:58 -07:00
Kristina Martšenko 4db0243565 staging: gdm72xx: use print_hex_dump_debug and remove debug macros
Since the kernel already has a function for hex dumps, use that instead
of the driver's own versions. The function supports dynamic debugging,
so also remove some unnecessary debug macros.

Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 19:53:58 -07:00
Alexey Khoroshilov d3a874e899 staging: gdm72xx: fix leaks at failure path in gdm_usb_probe()
Error handling code in gdm_usb_probe() misses to deallocate
tx_ and rx_structs and to do usb_put_dev().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07 09:19:30 -08:00
Arnd Bergmann 4b266e5fbc staging: gdm72xx: fix interruptible_sleep_on race
interruptible_sleep_on is racy and going away. This replaces the
use in the gdm72xx driver with the appropriate
wait_event_interruptible_lock_irq.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:41:44 -08:00
Linus Torvalds 9977d9b379 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull big execve/kernel_thread/fork unification series from Al Viro:
 "All architectures are converted to new model.  Quite a bit of that
  stuff is actually shared with architecture trees; in such cases it's
  literally shared branch pulled by both, not a cherry-pick.

  A lot of ugliness and black magic is gone (-3KLoC total in this one):

   - kernel_thread()/kernel_execve()/sys_execve() redesign.

     We don't do syscalls from kernel anymore for either kernel_thread()
     or kernel_execve():

     kernel_thread() is essentially clone(2) with callback run before we
     return to userland, the callbacks either never return or do
     successful do_execve() before returning.

     kernel_execve() is a wrapper for do_execve() - it doesn't need to
     do transition to user mode anymore.

     As a result kernel_thread() and kernel_execve() are
     arch-independent now - they live in kernel/fork.c and fs/exec.c
     resp.  sys_execve() is also in fs/exec.c and it's completely
     architecture-independent.

   - daemonize() is gone, along with its parts in fs/*.c

   - struct pt_regs * is no longer passed to do_fork/copy_process/
     copy_thread/do_execve/search_binary_handler/->load_binary/do_coredump.

   - sys_fork()/sys_vfork()/sys_clone() unified; some architectures
     still need wrappers (ones with callee-saved registers not saved in
     pt_regs on syscall entry), but the main part of those suckers is in
     kernel/fork.c now."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (113 commits)
  do_coredump(): get rid of pt_regs argument
  print_fatal_signal(): get rid of pt_regs argument
  ptrace_signal(): get rid of unused arguments
  get rid of ptrace_signal_deliver() arguments
  new helper: signal_pt_regs()
  unify default ptrace_signal_deliver
  flagday: kill pt_regs argument of do_fork()
  death to idle_regs()
  don't pass regs to copy_process()
  flagday: don't pass regs to copy_thread()
  bfin: switch to generic vfork, get rid of pointless wrappers
  xtensa: switch to generic clone()
  openrisc: switch to use of generic fork and clone
  unicore32: switch to generic clone(2)
  score: switch to generic fork/vfork/clone
  c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone()
  take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h
  mn10300: switch to generic fork/vfork/clone
  h8300: switch to generic fork/vfork/clone
  tile: switch to generic clone()
  ...

Conflicts:
	arch/microblaze/include/asm/Kbuild
2012-12-12 12:22:13 -08:00
Dan Carpenter e143ef8f29 staging: gdm72xx: unlock on error in init_usb()
We recently added locking here and there was an error path which is
missing an unlock.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29 18:16:15 -08:00
Al Viro c4144670fd kill daemonize()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-11-28 21:49:02 -05:00
Ben Chan a7e4a982fe staging: gdm72xx: fix unused variable warning in gdm_usb_send
This patch fixes an unused variable warning in gdm_usb_send
(when CONFIG_WIMAX_GDM72XX_K_MODE=n), which was introduced in
commit 1a276b8046 (staging:
gdm72xx: protect access of rx / tx structs).

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-27 09:18:15 -08:00
Ben Chan 1a276b8046 staging: gdm72xx: protect access of rx / tx structs
This patch applies spinlock to protect access to rx / tx structs in
certain call sites, which fixes the following crash in gdm_suspend.
It also fixes usb_set_intfdata() in gdm_usb_probe to avoid setting an
already freed phy_dev.

<5>[ 4996.815018] [<7f0074b0>] (gdm_suspend+0x1c/0x2b4 [gdmwm]) from [<803020a4>] (usb_suspend_both+0x80/0x1a0)
<5>[ 4996.815055] [<803020a4>] (usb_suspend_both+0x80/0x1a0) from [<80302c84>] (usb_runtime_suspend+0x38/0x64)
<5>[ 4996.815089] [<80302c84>] (usb_runtime_suspend+0x38/0x64) from [<802becc0>] (__rpm_callback+0x48/0x78)
<5>[ 4996.815118] [<802becc0>] (__rpm_callback+0x48/0x78) from [<802bf8dc>] (rpm_suspend+0x394/0x5ec)
<5>[ 4996.815145] [<802bf8dc>] (rpm_suspend+0x394/0x5ec) from [<802c0550>] (pm_runtime_work+0x8c/0xa4)
<5>[ 4996.815177] [<802c0550>] (pm_runtime_work+0x8c/0xa4) from [<800456cc>] (process_one_work+0x264/0x438)
<5>[ 4996.815209] [<800456cc>] (process_one_work+0x264/0x438) from [<80045acc>] (worker_thread+0x22c/0x3b8)
<5>[ 4996.815239] [<80045acc>] (worker_thread+0x22c/0x3b8) from [<8004a43c>] (kthread+0x9c/0xa8)
<5>[ 4996.815270] [<8004a43c>] (kthread+0x9c/0xa8) from [<8000f160>] (kernel_thread_exit+0x0/0x8)
<0>[ 4996.815295] Code: e92d4000 e8bd4000 e2800020 eb4ab9a1 (e5905000)

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:21:19 -08:00
YAMANE Toshiaki a7d46832df staging/gdm72xx: Use dev_ printks in gdm_usb.c
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 10:33:51 -07:00
Ben Chan 129575f2a8 staging: gdm72xx: simplify alloc_tx_struct and alloc_rx_struct
This patch simplifies alloc_tx_struct and alloc_rx_struct in gdm_sdio.c
and gdm_usb.c by replacing kmalloc+memset with kzalloc and reorganizing
the code.

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-13 20:15:41 -07:00
Macpaul Lin 0d66002556 staging/gdm72xx: gdm_usb coding style clean up
gdm_usb.* coding style clean up.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12 09:52:10 -07:00
Wei Yongjun 73295fe185 staging: gdm72xx: use list_move instead of list_del/list_add
Using list_move() instead of list_del() + list_add().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-06 09:25:22 -07:00
Wei Yongjun e5d2cb4a0b staging: gdm72xx: use list_move_tail instead of list_del/list_add_tail
Using list_move_tail() instead of list_del() + list_add_tail().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05 11:58:24 -07:00
Devendra Naga 07ad99c9e3 staging: gdm72xx: use kzalloc to allocate usb_tx structure
the code under alloc_tx_struct does the allocation of usb_tx structure
using kmalloc, and memsets the allocated pointer, instead we can
directly use kzalloc so that the allocated memory is set with
zeros

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 11:16:22 -07:00
Devendra Naga 7fc03add26 staging/gdm72xx: use kzalloc for phydev and udev
we are doing kmalloc and memset, can be done using kzalloc itself.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 18:53:47 -07:00
Ben Chan 0c16ae7629 staging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete
This patch simplifies the previous patch (commit
dd13c86b0d) for fixing the spinlock
recursion issue on several call sites of gdm_usb_send_complete.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 14:37:28 -07:00
Ben Chan dd13c86b0d staging: gdm72xx: Fix spinlock recursion on gdm_usb_send_complete
This patch fixes a spinlock recursion bug on several call sites of
gdm_usb_send_complete by not calling spin_lock_irqsave on
urb->context->tx_cxt->lock when the lock has already been acquired.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 10:52:32 -07:00
Devendra Naga 02fd3b3670 staging/gdm72xx: Remove version.h includes
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 10:34:47 -07:00
Adnan Ali ff5e4a1d27 Staging: gdm72xx: gdm_usb: fix deprecated function kernel_thread
This commit fixes deprecated function kernel_thread by replacing
it with kthread_run.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 10:34:47 -07:00
Paul Stewart 54bc1ff1da staging: gdm72xx: Set up parent link in sysfs for gdm72xx devices
This patch uses SET_NETDEV_DEV to set up a 'device' parent link in sysfs
(e.g. /sys/class/net/wm0/device) for a gdm72xx device.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 13:17:41 -07:00
Geert Uytterhoeven dd4f521399 staging: gdm72xx: WIMAX_GDM72XX_USB_PM should depend on USB_SUSPEND
Use Kconfig logic instead of a rude #error in the driver source,
which breaks m68k-allmodconfig.
Also remove the "default n", as that's the default.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16 13:17:52 -07:00
Sage Ahn 247e9cffdc staging: gdm72xx: Add GCT GDM72xx WiMAX driver.
This patch provides the kernel driver for the GDM72xx WiMAX chips
developed by GCT Semiconductor, Inc., which enables mobile WiMAX
connection on the Linux host.

Signed-off-by: Sage Ahn <syahn@gctsemi.com>
Cc: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-15 08:49:35 -07:00