staging: dgnc: fixes tty_port and tty_struct params

The functions tty_flip_buffer_push, tty_insert_flip_string,
tty_insert_flip_char and tty_buffer_request_room now require a struct of
type tty_port instead of struct tty_struct. This patch makes those
changes.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: dereferences ts var in dgnc_tty_close()

The value tty->termios needed to be dereferenced to be assigned to the
variable ts.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgcn: removes unnecessary commands in ioctl

The commands TIOCGETP, TCGETS, and TCGETA are not supposed to be seen by
the ioctl. This patch removes the switch cases for these commands.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: fixes ioctl param list

The declaration for the ioctl function has changed. The previous version
of this declaration took struct file *file as a parameter and the new
one does not. This patch removes that parameter.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: removes read_cnt, real_raw, rawreadok and buf

This patch removes the use of read_cnt, real_raw, buf and rawreadok. The
variable buf is never used in the code. The variables rawreadok read_cnt
and real_raw don't exist in the new API. Reading the data raw is no
longer supported by the tty layer.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Add a blank line between declaraction and code.

This patch adds blank line between declaration &
code for readability.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Add a blank line between functions & declarations.

This patch adds a blank line between global declarations &
functions for readability.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Simply if condition

Making code simpler for readability.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Fix coding style.

Put spaces around math operations.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Remove unnecessary pointer check.

We are already checking "ep" earlier in function. Do not
need to check again.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Make oz_hcd_pd_arrived() return a struct pointer

oz_hcd_pd_arrived returns struct oz_port *, change function
declaration to avoid ambiguity.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Make oz_hcd_pd_departed() take a struct pointer.

oz_hcd_pd_departed() takes struct oz_port pointer instead of
void *, change function declaration to avoid ambiguity.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Remove unneeded initializers

Remove variable initialization wherever it is not required.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Swap arguments of oz_ep_alloc() to match kmalloc()

Swap arguments of oz_ep_alloc() to match kmalloc() for better readability.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ozwpan: Separate success & failure case for oz_hcd_pd_arrived()

This patch separates success & failure block along with fixing
following issues:-

1. The way oz_hcd_pd_arrived() looks now it's easy to think we free "ep" but
actually we do this spaghetti thing of setting it to NULL on success.

2. It is hard to read it because there are unlocks scattered throughout.

3. Currently we set "ep" to NULL on the success path and then test it and or
free it. In current code you have to scroll to the start of the function
to read code.

Original patch was submitted by Dan here :-
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-August/040113.html

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Only the first 4 members of these structures are live.

The forth member is referenced at run-time by packed structures.
typedef struct tagSTxBufHead
typedef struct tagSTxShortBufHead
in desc.h

If these structures are not packed the alignment of these members
will be wrong.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: vt6656: rxtx.h dead code typedef union tagUTX_BUFFER_CONTAINER

This is part of the Remote NDIS message format with patch

vt6656: rxtx.c: s_vGetFreeContext use single tx memset.

there is not need for this structure and its members.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
PCI: Split out pci_dev lock/unlock and save/restore

Only cosmetic code changes to existing paths.  Expand the comment in
the new pci_dev_save_and_disable() function since there's a lot
hidden in that Command register write.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
PCI: Add pci_reset_slot() and pci_reset_bus()

Sometimes pci_reset_function() is not sufficient.  We have cases where
devices do not support any kind of reset, but there might be multiple
functions on the bus preventing pci_reset_function() from doing a
secondary bus reset.  We also have cases where a device will advertise
that it supports a PM reset, but really does nothing on D3hot->D0
(graphics cards are notorious for this).  These devices often also
have more than one function, so even blacklisting PM reset for them
wouldn't allow a secondary bus reset through pci_reset_function().

If a driver supports multiple devices it should have the ability to
induce a bus reset when it needs to.  This patch provides that ability
through pci_reset_slot() and pci_reset_bus().  It's the caller's
responsibility when using these interfaces to understand that all of
the devices in or below the slot (or on or below the bus) will be
reset and therefore should be under control of the caller.  PCI state
of all the affected devices is saved and restored around these resets,
but internal state of all of the affected devices is reset (which
should be the intention).

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
PCI: Wake-up devices before saving config space for reset

Devices come out of reset in D0.  Restoring a device to a different
post-reset state takes more smarts than our simple config space
restore, which can leave devices in an inconsistent state.  For
example, if a device is reset in D3, but the restore doesn't
successfully return the device to D3, then the actual state of the
device and dev->current_state are contradictory.  Put everything
in D0 going into the reset, then we don't need to do anything
special on the way out.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>