This is a note to let you know that I've just added the patch titled
Subject: USB: serial: pl2303: clean up urb->status usage
to my gregkh-2.6 tree. Its filename is
usb-pl2303-status.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From foo@baz Tue Apr 9 12:12:43 2002
Date: Fri, 15 Jun 2007 15:44:13 -0700
To: Greg KH <[email protected]>
From: Greg Kroah-Hartman <[email protected]>
Subject: USB: serial: pl2303: clean up urb->status usage
From: Greg Kroah-Hartman <[email protected]>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/usb/serial/pl2303.c | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -961,11 +961,12 @@ static void pl2303_read_int_callback(str
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
unsigned char *data = urb->transfer_buffer;
unsigned int actual_length = urb->actual_length;
- int status;
+ int status = urb->status;
+ int retval;
dbg("%s (%d)", __FUNCTION__, port->number);
- switch (urb->status) {
+ switch (status) {
case 0:
/* success */
break;
@@ -974,11 +975,11 @@ static void pl2303_read_int_callback(str
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
- urb->status);
+ status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
- urb->status);
+ status);
goto exit;
}
@@ -988,11 +989,11 @@ static void pl2303_read_int_callback(str
pl2303_update_line_status(port, data, actual_length);
exit:
- status = usb_submit_urb(urb, GFP_ATOMIC);
- if (status)
+ retval = usb_submit_urb(urb, GFP_ATOMIC);
+ if (retval)
dev_err(&urb->dev->dev,
"%s - usb_submit_urb failed with result %d\n",
- __FUNCTION__, status);
+ __FUNCTION__, retval);
}
static void pl2303_read_bulk_callback(struct urb *urb)
@@ -1004,23 +1005,23 @@ static void pl2303_read_bulk_callback(st
unsigned long flags;
int i;
int result;
- u8 status;
+ int status = urb->status;
+ u8 line_status;
char tty_flag;
dbg("%s - port %d", __FUNCTION__, port->number);
- if (urb->status) {
- dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
+ if (status) {
+ dbg("%s - urb status = %d", __FUNCTION__, status);
if (!port->open_count) {
dbg("%s - port is closed, exiting.", __FUNCTION__);
return;
}
- if (urb->status == -EPROTO) {
+ if (status == -EPROTO) {
/* PL2303 mysteriously fails with -EPROTO reschedule
* the read */
dbg("%s - caught -EPROTO, resubmitting the urb",
__FUNCTION__);
- urb->status = 0;
urb->dev = port->serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC);
if (result)
@@ -1040,18 +1041,18 @@ static void pl2303_read_bulk_callback(st
tty_flag = TTY_NORMAL;
spin_lock_irqsave(&priv->lock, flags);
- status = priv->line_status;
+ line_status = priv->line_status;
priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
spin_unlock_irqrestore(&priv->lock, flags);
wake_up_interruptible(&priv->delta_msr_wait);
/* break takes precedence over parity, */
/* which takes precedence over framing errors */
- if (status & UART_BREAK_ERROR )
+ if (line_status & UART_BREAK_ERROR )
tty_flag = TTY_BREAK;
- else if (status & UART_PARITY_ERROR)
+ else if (line_status & UART_PARITY_ERROR)
tty_flag = TTY_PARITY;
- else if (status & UART_FRAME_ERROR)
+ else if (line_status & UART_FRAME_ERROR)
tty_flag = TTY_FRAME;
dbg("%s - tty_flag = %d", __FUNCTION__, tty_flag);
@@ -1059,7 +1060,7 @@ static void pl2303_read_bulk_callback(st
if (tty && urb->actual_length) {
tty_buffer_request_room(tty, urb->actual_length + 1);
/* overrun is special, not associated with a char */
- if (status & UART_OVERRUN_ERROR)
+ if (line_status & UART_OVERRUN_ERROR)
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
for (i = 0; i < urb->actual_length; ++i)
tty_insert_flip_char(tty, data[i], tty_flag);
@@ -1083,10 +1084,11 @@ static void pl2303_write_bulk_callback(s
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
struct pl2303_private *priv = usb_get_serial_port_data(port);
int result;
+ int status = urb->status;
dbg("%s - port %d", __FUNCTION__, port->number);
- switch (urb->status) {
+ switch (status) {
case 0:
/* success */
break;
@@ -1095,14 +1097,14 @@ static void pl2303_write_bulk_callback(s
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
- urb->status);
+ status);
priv->write_urb_in_use = 0;
return;
default:
/* error in the urb, so we have to resubmit it */
dbg("%s - Overflow in write", __FUNCTION__);
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
- urb->status);
+ status);
port->write_urb->transfer_buffer_length = 1;
port->write_urb->dev = port->serial->dev;
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
Patches currently in gregkh-2.6 which might be from [email protected] are
bad/pci-domain/pci-device-ensure-sysdata-initialised.patch
bad/pci-domain/pci-fix-the-x86-pci-domain-support-fix.patch
bad/relayfs/sysfs-update-relay-file-support-for-generic-relay-api.patch
bad/relayfs/relay-consolidate-relayfs-core-into-kernel-relay.c.patch
bad/relayfs/relay-relay-header-cleanup.patch
bad/relayfs/relayfs-remove-relayfs-in-favour-of-config_relay.patch
bad/relayfs/sysfs-add-__attr_relay-helper-for-relay-attributes.patch
bad/relayfs/sysfs-relay-channel-buffers-as-sysfs-attributes.patch
bad/usbip/usb-usbip-more-dead-code-fix.patch
bad/usbip/usb-usbip-build-fix.patch
bad/usbip/usb-usbip-warning-fixes.patch
bad/ndevfs.patch
bad/battery-class-driver.patch
bad/driver-model-convert-driver-model-to-mutexes.patch
bad/gpl_future-test.patch
bad/gregkh-debugfs_example.patch
bad/speakup-kconfig-fix.patch
bad/speakup-build-fix.patch
bad/pci-use-new-multi-phase-suspend-infrastructure.patch
bad/shot-accross-the-bow.patch
bad/no-more-non-gpl-modules.patch
bad/spi-device.patch
bad/ata_piix-multithread.patch
bad/uio-irq.patch
bad/pci-two-drivers-on-one-pci-device.patch
bad/pci-dynamic-id-cleanup.patch
bad/input-device.patch
driver/nozomi.patch
driver/uio.patch
driver/uio-documentation.patch
driver/driver-core-make-devt_attr-and-uevent_attr-static.patch
driver/sysfs-rules.patch
driver/uio-hilscher-cif-card-driver.patch
driver/sysfs-add-sysfs_dirent-s_name.patch
driver/debugfs-add-rename-for-debugfs-files.patch
driver/sysfs-consolidate-sysfs_dirent-creation-functions.patch
driver/sysfs-add-sysfs_dirent-s_parent.patch
driver/sysfs-allocate-inode-number-using-ida.patch
driver/sysfs-kill-attribute-file-orphaning.patch
driver/sysfs-fix-error-handling-in-binattr-write.patch
driver/sysfs-flatten-and-fix-sysfs_rename_dir-error-handling.patch
driver/sysfs-flatten-cleanup-paths-in-sysfs_add_link-and-create_dir.patch
driver/sysfs-implement-bin_buffer.patch
driver/sysfs-implement-kobj_sysfs_assoc_lock.patch
driver/sysfs-implement-sysfs_dirent-active-reference-and-immediate-disconnect.patch
driver/sysfs-kill-unnecessary-attribute-owner.patch
driver/sysfs-make-sysfs_dirent-s_element-a-union.patch
driver/howto-translated-into-japanese.patch
driver/sysfs-make-sysfs_put-ignore-null-sd.patch
driver/sysfs-move-release_sysfs_dirent-to-dir.c.patch
driver/sysfs-reimplement-symlink-using-sysfs_dirent-tree.patch
driver/sysfs-reimplement-sysfs_drop_dentry.patch
driver/sysfs-separate-out-sysfs_attach_dentry.patch
driver/ida-implement-idr-based-id-allocator.patch
driver/idr-fix-obscure-bug-in-allocation-path.patch
driver/idr-separate-out-idr_mark_full.patch
driver/sysfs-fix-oops-in-sysfs_drop_dentry-on-x86_64.patch
driver/sysfs-fix-root-sysfs_dirent-root-dentry-association.patch
driver/driver-core-add-missing-kset-uevent.patch
driver/power-management-use-mutexes-instead-of-semaphores.patch
driver/sysdev-use-mutex-instead-of-semaphore.patch
driver/sysfs-fix-parent-refcounting-during-rename-and-move.patch
driver/sysfs-implement-sysfs_find_dirent-and-sysfs_get_dirent.patch
driver/sysfs-make-sysfs_alloc_ino-static.patch
driver/sysfs-move-s_active-functions-to-fs-sysfs-dir.c.patch
driver/sysfs-reorganize-sysfs_new_indoe-and-sysfs_create.patch
driver/sysfs-slim-down-sysfs_dirent-s_active.patch
driver/sysfs-use-iget_locked-instead-of-new_inode.patch
driver/sysfs-use-singly-linked-list-for-sysfs_dirent-tree.patch
driver/sysfs-use-sysfs_mutex-to-protect-the-sysfs_dirent-tree.patch
driver/pm-remove-pm_parent-from-struct-dev_pm_info.patch
driver/pm-remove-saved_state-from-struct-dev_pm_info.patch
driver/pm-simplify-suspend_device.patch
driver/sysfs-consolidate-sysfs-spinlocks.patch
driver/sysfs-implement-sysfs_flag_removed-flag.patch
driver/sysfs-implement-sysfs_get_dentry.patch
driver/sysfs-make-directory-dentries-and-inodes-reclaimable.patch
driver/sysfs-make-kobj-point-to-sysfs_dirent-instead-of-dentry.patch
driver/sysfs-make-sysfs_drop_dentry-access-inodes-using-ilookup.patch
driver/sysfs-move-sysfs_drop_dentry-to-dir.c-and-make-it-static.patch
driver/sysfs-rename-sysfs_dirent-s_type-to-s_flags-and-make-room-for-flags.patch
driver/sysfs-restructure-add-remove-paths-and-fix-inode-update.patch
gregkh/gkh-version.patch
gregkh/sysfs-test.patch
gregkh/sysrq-u-laptop.patch
pci/pci_bridge-device.patch
pci/pci-piggy-bus.patch
pci/pci-make-pcibios_add_platform_entries-return-errors.patch
pci/pci-use-a-weak-symbol-for-the-empty-version-of-pcibios_add_platform_entries.patch
pci/pci-pci_find_slot-mark-deprecated.patch
pci/pci-remove-cpqphp-maintainer.patch
pci/pci-remove-useless-pci-driver-method.patch
pci/pci-fix-the-error-message-to-point-to-the-proper-person.patch
pci/pci-syscall.c-switch-to-refcounting-api.patch
usb/usb-gotemp.patch
usb/usb-stimulus.patch
usb/usb-add-usb-persist-facility.patch
usb/usb-core-hub.c-prevent-re-enumeration-on-hnp.patch
usb/usb-serial-license-fix.patch
usb/usb-aircable-status.patch
usb/usb-airprime-status.patch
usb/usb-belkin_sa-status.patch
usb/usb-ehci-safe-endianness-for-transfer-buffers-after-reset-in-case-of-hub-with-tt.patch
usb/usb-cyberjack-status.patch
usb/usb-cypress_m8-status.patch
usb/usb-digi_acceleport-status.patch
usb/usb-empeg-status.patch
usb/usb-ftdi_sio-status.patch
usb/usb-usb-serial-gadget-sparse-fixes.patch
usb/usb-suspend-support-for-usb-serial.patch
usb/usb-add-reset_resume-device-quirk.patch
usb/usb-ehci-cpufreq-fix.patch
usb/usb-ehci-support-for-big-endian-descriptors.patch
usb/usb-garmin_gps-status.patch
usb/usb-don-t-unsuspend-for-a-new-connection.patch
usb/usb-implement-pm-freeze-and-prethaw.patch
usb/usb-disable-file_storage-usb_config_att_wakeup.patch
usb/usb-interface-pm-state.patch
usb/usb-make-hub-driver-s-release-more-robust.patch
usb/usb-move-bus_suspend-and-bus_resume-method-calls.patch
usb/usb-remove-locktree-routine-from-the-hub-driver.patch
usb/usb-remove-references-to-dev.power.power_state.patch
usb/usb-generic-status.patch
usb/usb-io_edgeport-status.patch
usb/usb-io_ti-status.patch
usb/usb-cxacru-cleanup-sysfs-attribute-code.patch
usb/usb-make-device-reset-stop-retrying-after-disconnect.patch
usb/usb-add-power-persist-device-attribute.patch
usb/usb-ipw-status.patch
usb/usb-ehci-refcounts-work-on-ppc7448.patch
usb/usb-m66592-udc-peripheral-controller-driver-for-m66592.patch
usb/usb-add-reset_resume-method.patch
usb/usb-r8a66597-hcd-host-controller-driver-for-r8a66597.patch
usb/usb-g_file_storage-call-allow_signal.patch
usb/usb-m66592-udc-fix-use-old-interrupt-flags.patch
usb/usb-ipaq-status.patch
usb/usb-serial-keyspan-add-support-for-usa-49wg-usa-28xg.patch
usb/usb-use-menuconfig-objects.patch
usb/usb-r8a66597-hcd-fix-null-access.patch
usb/usb-remove-__usb_port_suspend.patch
usb/usb-remove-excess-code-from-hub.c.patch
usb/usb-separate-root-and-non-root-suspend-resume.patch
usb/usb-unify-reset_resume-and-normal-resume.patch
usb/usb-fsl_usb2_udc-get-max-ep-number-from-dccparams-register.patch
usb/usb-add-usb_device_and_interface_info-for-device-matching.patch
usb/usb-ehci-fix-handover-for-designated-full-speed-ports.patch
usb/usb-ehci-ohci-handover-changes.patch
usb/usb-gadget-driver-for-samsung-s3c2410-arm-soc.patch
usb/usb-io_ti-digi-edgeport-update-for-new-devices.patch
usb/usb-option-fix-usage-of-urb-status-abuse.patch
usb/usb-oti6858-usb-serial-driver.patch
usb/usb-prevent-char-device-open-deregister-race.patch
usb/usb-rework-c-style-comments.patch
usb/usb-usb-gadget-dead-config-cleanup.patch
usb/usbmon-add-class-for-binary-interface.patch
usb/usb-usb-host-side-can-be-configured-given-pcmcia.patch
usb/ehci-hub-improved-over-current-recovery.patch
usb/usb-ehci-big-endian-data-structures-support.patch
usb/usb-export-linux-usb_gadgetfs-as-linux-usb-gadgetfs.h.patch
usb/usb-ir-usb-status.patch
usb/usb-set-config_usb_ehci_big_endian_mmio-_desc-in-usb-host-kconfig.patch
usb/pl2303.c-patch.patch
usb/usb-usb-storage-use-kthread_stop-for-the-control-thread.patch
usb/usb-keyspan-status.patch
usb/usb-keyspan_pda-status.patch
usb/usb-handle-bogus-low-speed-bulk-endpoints.patch
usb/usb-free-dma-mappings-if-enqueue-fails.patch
usb/usb-kl5kusb105-status.patch
usb/usb-kobil_sct-status.patch
usb/usb-mct_u232-status.patch
usb/usb-mos7720-status.patch
usb/usb-mos7840-status.patch
usb/usb-navman-status.patch
usb/usb-omninet-status.patch
usb/usb-option-status.patch
usb/usb-oti6858-status.patch
usb/usb-pl2303-status.patch
usb/usb-safe_serial-status.patch
usb/usb-sierra-status.patch
usb/usb-ti_usb_3410_5052-status.patch
usb/usb-visor-status.patch
usb/usb-whiteheat-status.patch
HOWTO
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.