Linux 2.6.27.40
Subsystems (15)
I'm announcing the release of the 2.6.27.40 kernel. All users of the 2.6.27 kernel series are very strongly encouraged to upgrade.
The updated 2.6.27.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.27.y.git
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.27.y.git;a=summarythanks,
greg k-h
------------
Makefile | 2 arch/x86/kernel/acpi/processor.c | 3 drivers/dca/dca-core.c | 51 ++++++++++----- drivers/hwmon/it87.c | 2 drivers/isdn/hisax/hfc_usb.c | 4 - drivers/media/common/tuners/tda18271-fe.c | 8 +- drivers/media/dvb/frontends/dib7000p.c | 5 + drivers/media/video/em28xx/em28xx-audio.c | 5 + drivers/media/video/s2255drv.c | 5 - drivers/misc/thinkpad_acpi.c | 2 drivers/scsi/gdth.c | 2 drivers/usb/host/ohci-hcd.c | 5 + drivers/usb/host/ohci-pci.c | 20 ++++++ drivers/usb/host/ohci-q.c | 18 +++-- drivers/usb/host/ohci.h | 9 ++ drivers/usb/serial/aircable.c | 5 - drivers/usb/serial/belkin_sa.c | 7 -- drivers/usb/serial/cp2101.c | 6 - drivers/usb/serial/cyberjack.c | 20 ++++-- drivers/usb/serial/cypress_m8.c | 11 +-- drivers/usb/serial/digi_acceleport.c | 20 ++++-- drivers/usb/serial/empeg.c | 8 -- drivers/usb/serial/ftdi_sio.c | 14 ---- drivers/usb/serial/garmin_gps.c | 16 ++++ drivers/usb/serial/generic.c | 9 ++ drivers/usb/serial/io_edgeport.c | 29 ++++++-- drivers/usb/serial/io_tables.h | 12 ++- drivers/usb/serial/io_ti.c | 22 +++++- drivers/usb/serial/ipaq.c | 7 -- drivers/usb/serial/iuu_phoenix.c | 6 - drivers/usb/serial/keyspan.c | 13 +++- drivers/usb/serial/keyspan.h | 12 ++- drivers/usb/serial/keyspan_pda.c | 4 - drivers/usb/serial/kl5kusb105.c | 39 ++++++------ drivers/usb/serial/kobil_sct.c | 12 +-- drivers/usb/serial/mct_u232.c | 13 +--- drivers/usb/serial/mos7720.c | 9 -- drivers/usb/serial/mos7840.c | 48 ++++++++++++-- drivers/usb/serial/omninet.c | 19 ++++- drivers/usb/serial/option.c | 97 +++++++++++++++++++++++++++--- drivers/usb/serial/oti6858.c | 7 -- drivers/usb/serial/pl2303.c | 5 - drivers/usb/serial/sierra.c | 28 +++++++- drivers/usb/serial/spcp8x5.c | 5 - drivers/usb/serial/ti_usb_3410_5052.c | 10 +-- drivers/usb/serial/usb-serial.c | 29 ++++---- drivers/usb/serial/visor.c | 13 +--- drivers/usb/serial/whiteheat.c | 6 - fs/fuse/dir.c | 3 fs/fuse/file.c | 3 fs/jffs2/read.c | 9 +- include/linux/usb/serial.h | 12 ++- sound/arm/aaci.c | 6 + sound/usb/usbaudio.h | 2 54 files changed, 493 insertions(+), 244 deletions(-)
Alan Stern (1):
USB: usb-serial: replace shutdown with disconnect, release
Anand V. Avati (1):
fuse: prevent fuse_put_request on invalid pointer
Csaba Henk (1):
fuse: reject O_DIRECT flag also in fuse_create
Dave Jones (1):
gdth: Prevent negative offsets in ioctl CVE-2009-3080
David Woodhouse (1):
jffs2: Fix memory corruption in jffs2_read_inode_range()
Devin Heitmueller (1):
V4L/DVB (13190): em28xx: fix panic that can occur when starting audio streaming
Greg Kroah-Hartman (1):
Linux 2.6.27.40
Harald Welte (1):
Enable ACPI PDC handshake for VIA/Centaur CPUs
Jean Delvare (1):
hwmon: (it87) Fix VID reading on IT8718F
Julian Anastasov (1):
ALSA: usb-audio: fix combine_word problem
Libin Yang (1):
USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer
Maciej Sosnowski (1):
dca: redesign locks to fix deadlocks
Martin Samek (1):
V4L/DVB (13079): dib0700: fixed xc2028 firmware loading kernel oops
Michael Krufky (1):
V4L/DVB (13107): tda18271: fix overflow in FM radio frequency calculation
Mike Isely (1):
V4L/DVB (13230): s2255drv: Don't conditionalize video buffer completion on waiting processes
Oliver Neukum (1):
USB: suspend/resume support for option driver
Roel Kluin (2):
isdn: hfc_usb: Fix read buffer overflow
thinkpad-acpi: fix sign of ERESTARTSYS return
Russell King (2):
ALSA: AACI: fix AC97 multiple-open bug
ALSA: AACI: fix recording bug
Seth Barry (1):
V4L/DVB (13109): tda18271: fix signedness issue in tda18271_rf_tracking_filters_init
Makefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 27 -EXTRAVERSION = .39 +EXTRAVERSION = .40 NAME = Trembling Tortoise # *DOCUMENTATION*
arch/x86/kernel/acpi/processor.c +2 -1
@@ -78,7 +78,8 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)struct cpuinfo_x86 *c = &cpu_data (pr->id); pr->pdc =NULL ; -if (c->x86_vendor ==X86_VENDOR_INTEL ) +if (c->x86_vendor ==X86_VENDOR_INTEL || + c->x86_vendor ==X86_VENDOR_CENTAUR )init_intel_pdc (pr, c);return ;
drivers/dca/dca-core.c +33 -18
137 lines not on this page · raw message
drivers/hwmon/it87.c +1 -1
@@ -1017,7 +1017,7 @@ static int __init it87_find(unsigned short *address,int reg;superio_select (GPIO ); -if (chip_type == it8718) +if (sio_data->type == it8718) sio_data->vid_value =superio_inb (IT87_SIO_VID_REG ); reg =superio_inb (IT87_SIO_PINX2_REG );
drivers/isdn/hisax/hfc_usb.c +2 -2
@@ -818,8 +818,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) }/* we have a complete hdlc packet */ if (finish) { -if ((!fifo->skbuff->data[fifo->skbuff->len -1 ]) - && (fifo->skbuff->len >3 )) { +if (fifo->skbuff->len >3 && + !fifo->skbuff->data[fifo->skbuff->len -1 ]) {if (fifon ==HFCUSB_D_RX ) { DBG(HFCUSB_DBG_DCHANNEL,
drivers/media/common/tuners/tda18271-fe.c +4 -4
@@ -595,13 +595,13 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)case RF2 : map[i].rf_a1 = (prog_cal[RF2 ] - prog_tab[RF2 ] - prog_cal[RF1 ] + prog_tab[RF1 ]) / - ((rf_freq[RF2 ] - rf_freq[RF1 ]) /1000 ); + (s32)((rf_freq[RF2 ] - rf_freq[RF1 ]) /1000 ); map[i].rf2 = rf_freq[RF2 ] /1000 ;break ;case RF3 : map[i].rf_a2 = (prog_cal[RF3 ] - prog_tab[RF3 ] - prog_cal[RF2 ] + prog_tab[RF2 ]) / - ((rf_freq[RF3 ] - rf_freq[RF2 ]) /1000 ); + (s32)((rf_freq[RF3 ] - rf_freq[RF2 ]) /1000 ); map[i].rf_b2 = prog_cal[RF2 ] - prog_tab[RF2 ]; map[i].rf3 = rf_freq[RF3 ] /1000 ;break ;
@@ -927,12 +927,12 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,struct tda18271_std_map_item *map;char *mode;int ret; -u32 freq = params->frequency *62500 ; +u32 freq = params->frequency *125 * + ((params->mode ==V4L2_TUNER_RADIO ) ?1 :1000 ) /2 ; priv->mode =TDA18271_ANALOG ;if (params->mode ==V4L2_TUNER_RADIO ) { - freq = freq /1000 ; map = &std_map->fm_radio; mode ="fm" ; }else if (params->std &V4L2_STD_MN ) {
drivers/media/dvb/frontends/dib7000p.c +5 -0
@@ -1343,6 +1343,11 @@ struct dvb_frontend * dib7000p_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr,if (dib7000p_identify (st) !=0 ) goto error; +/* FIXME: make sure the dev.parent field is initialized, or else +request_firmware() will hit an OOPS (this should be moved somewhere +more common) */ + st->i2c_master.gated_tuner_i2c_adap.dev.parent = i2c_adap->dev.parent; +dibx000_init_i2c_master (&st->i2c_master,DIB7000P , st->i2c_adap, st->i2c_addr);dib7000p_demod_reset (st);
drivers/media/video/em28xx/em28xx-audio.c +5 -0
@@ -365,6 +365,11 @@ static int snd_em28xx_hw_capture_free(struct snd_pcm_substream *substream)static int snd_em28xx_prepare (struct snd_pcm_substream *substream) { +struct em28xx *dev =snd_pcm_substream_chip (substream); + + dev->adev.hwptr_done_capture =0 ; + dev->adev.capture_transfer_done =0 ; +return 0 ; }
drivers/media/video/s2255drv.c +0 -5
@@ -578,11 +578,6 @@ static int s2255_got_frame(struct s2255_dev *dev, int chn) buf =list_entry (dma_q->active.next, struct s2255_buffer, vb.queue); -if (!waitqueue_active (&buf->vb.done)) { -/* no one active */ - rc =-1 ; - goto unlock; - }list_del (&buf->vb.queue);do_gettimeofday (&buf->vb.ts);dprintk (100 ,"[%p/%d] wakeup\n" , buf, buf->vb.i);
drivers/misc/thinkpad_acpi.c +1 -1
@@ -5042,7 +5042,7 @@ static int brightness_write(char *buf)* Doing it this way makes the syscall restartable in case of EINTR */ rc =brightness_set (level); -return (rc == -EINTR )?ERESTARTSYS : rc; +return (rc == -EINTR )? -ERESTARTSYS : rc; }static struct ibm_struct brightness_driver_data = {
drivers/scsi/gdth.c +1 -1
@@ -2912,7 +2912,7 @@ static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr) eindex = handle; estr->event_source =0 ; -if (eindex >=MAX_EVENTS ) { +if (eindex <0 || eindex >=MAX_EVENTS ) {spin_unlock_irqrestore (&ha->smp_lock, flags);return eindex; }
drivers/usb/host/ohci-hcd.c +5 -0
@@ -89,6 +89,7 @@ static int ohci_restart (struct ohci_hcd *ohci);#ifdef CONFIG_PCI static void quirk_amd_pll (int state);static void amd_iso_dev_put (void ); +static void sb800_prefetch (struct ohci_hcd *ohci,int on);#else static inline void quirk_amd_pll (int state) {
@@ -98,6 +99,10 @@ static inline void amd_iso_dev_put(void) {return ; } +static inline void sb800_prefetch (struct ohci_hcd *ohci,int on) +{ +return ; +}#endif
drivers/usb/host/ohci-pci.c +20 -0
@@ -177,6 +177,13 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)return 0 ;pci_read_config_byte (amd_smbus_dev,PCI_REVISION_ID , &rev); + +/* SB800 needs pre-fetch fix */ +if ((rev >=0x40 ) && (rev <=0x4f )) { + ohci->flags |=OHCI_QUIRK_AMD_PREFETCH ; +ohci_dbg (ohci,"enabled AMD prefetch quirk\n" ); + } +if ((rev >0x3b ) || (rev <0x30 )) {pci_dev_put (amd_smbus_dev); amd_smbus_dev =NULL ;
@@ -262,6 +269,19 @@ static void amd_iso_dev_put(void) } +static void sb800_prefetch (struct ohci_hcd *ohci,int on) +{ +struct pci_dev *pdev; +u16 misc; + + pdev =to_pci_dev (ohci_to_hcd (ohci)->self.controller); +pci_read_config_word (pdev,0x50 , &misc); +if (on ==0 ) +pci_write_config_word (pdev,0x50 , misc &0xfcff ); +else +pci_write_config_word (pdev,0x50 , misc |0x0300 ); +} +/* List of quirks for OHCI */ static const struct pci_device_id ohci_pci_quirks[] = { {
drivers/usb/host/ohci-q.c +12 -6
@@ -49,9 +49,12 @@ __acquires(ohci->lock)switch (usb_pipetype (urb->pipe)) {case PIPE_ISOCHRONOUS :ohci_to_hcd (ohci)->self.bandwidth_isoc_reqs--; -if (ohci_to_hcd (ohci)->self.bandwidth_isoc_reqs ==0 - &&quirk_amdiso (ohci)) -quirk_amd_pll (1 ); +if (ohci_to_hcd (ohci)->self.bandwidth_isoc_reqs ==0 ) { +if (quirk_amdiso (ohci)) +quirk_amd_pll (1 ); +if (quirk_amdprefetch (ohci)) +sb800_prefetch (ohci,0 ); + }break ;case PIPE_INTERRUPT :ohci_to_hcd (ohci)->self.bandwidth_int_reqs--;
@@ -680,9 +683,12 @@ static void td_submit_urb ( data + urb->iso_frame_desc [cnt].offset, urb->iso_frame_desc [cnt].length, urb, cnt); } -if (ohci_to_hcd (ohci)->self.bandwidth_isoc_reqs ==0 - &&quirk_amdiso (ohci)) -quirk_amd_pll (0 ); +if (ohci_to_hcd (ohci)->self.bandwidth_isoc_reqs ==0 ) { +if (quirk_amdiso (ohci)) +quirk_amd_pll (0 ); +if (quirk_amdprefetch (ohci)) +sb800_prefetch (ohci,1 ); + } periodic =ohci_to_hcd (ohci)->self.bandwidth_isoc_reqs++ ==0 &&ohci_to_hcd (ohci)->self.bandwidth_int_reqs ==0 ;break ;
drivers/usb/host/ohci.h +9 -0
@@ -402,6 +402,7 @@ struct ohci_hcd {#define OHCI_QUIRK_FRAME_NO 0x80/* no big endian frame_no shift */ #define OHCI_QUIRK_HUB_POWER 0x100/* distrust firmware power/oc setup */ #define OHCI_QUIRK_AMD_ISO 0x200/* ISO transfers*/ +#define OHCI_QUIRK_AMD_PREFETCH 0x400/* pre-fetch for ISO transfer */ // there are also chip quirks/bugs in init logic struct work_struct nec_work;/* Worker for NEC quirk */
@@ -433,6 +434,10 @@ static inline int quirk_amdiso(struct ohci_hcd *ohci) {return ohci->flags &OHCI_QUIRK_AMD_ISO ; } +static inline int quirk_amdprefetch (struct ohci_hcd *ohci) +{ +return ohci->flags &OHCI_QUIRK_AMD_PREFETCH ; +}#else static inline int quirk_nec (struct ohci_hcd *ohci) {
@@ -446,6 +451,10 @@ static inline int quirk_amdiso(struct ohci_hcd *ohci) {return 0 ; } +static inline int quirk_amdprefetch (struct ohci_hcd *ohci) +{ +return 0 ; +}#endif /* convert between an hcd pointer and the corresponding ohci_hcd */
drivers/usb/serial/aircable.c +2 -3
@@ -362,7 +362,7 @@ static int aircable_attach(struct usb_serial *serial)return 0 ; } -static void aircable_shutdown (struct usb_serial *serial) +static void aircable_release (struct usb_serial *serial) {struct usb_serial_port *port = serial->port[0 ];
@@ -373,7 +373,6 @@ static void aircable_shutdown(struct usb_serial *serial)if (priv) {serial_buf_free (priv->tx_buf);serial_buf_free (priv->rx_buf); -usb_set_serial_port_data (port,NULL );kfree (priv); } }
@@ -598,7 +597,7 @@ static struct usb_serial_driver aircable_device = { .num_ports = 1, .attach = aircable_attach, .probe = aircable_probe, - .shutdown = aircable_shutdown, + .release = aircable_release, .write = aircable_write, .write_room = aircable_write_room, .write_bulk_callback = aircable_write_bulk_callback,
drivers/usb/serial/belkin_sa.c +3 -4
@@ -90,7 +90,7 @@ static int debug;/* function prototypes for a Belkin USB Serial Adapter F5U103 */ static int belkin_sa_startup (struct usb_serial *serial); -static void belkin_sa_shutdown (struct usb_serial *serial); +static void belkin_sa_release (struct usb_serial *serial);static int belkin_sa_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void belkin_sa_close(struct tty_struct *tty,
@@ -143,7 +143,7 @@ static struct usb_serial_driver belkin_device = { .tiocmget = belkin_sa_tiocmget, .tiocmset = belkin_sa_tiocmset, .attach = belkin_sa_startup, - .shutdown = belkin_sa_shutdown, + .release = belkin_sa_release, };
@@ -198,14 +198,13 @@ static int belkin_sa_startup(struct usb_serial *serial) } -static void belkin_sa_shutdown (struct usb_serial *serial) +static void belkin_sa_release (struct usb_serial *serial) {struct belkin_sa_private *priv;int i;dbg ("%s" , __func__); -/* stop reads and writes on all ports */ for (i =0 ; i < serial->num_ports; ++i) {/* My special items, the standard routines free my urbs */ priv =usb_get_serial_port_data (serial->port[i]);
drivers/usb/serial/cp2101.c +3 -3
@@ -50,7 +50,7 @@ static int cp2101_tiocmset(struct tty_struct *, struct file *, unsigned int, unsigned int);static void cp2101_break_ctl (struct tty_struct *,int );static int cp2101_startup (struct usb_serial *); -static void cp2101_shutdown (struct usb_serial *); +static void cp2101_disconnect (struct usb_serial *);static int debug;
@@ -125,7 +125,7 @@ static struct usb_serial_driver cp2101_device = { .tiocmget = cp2101_tiocmget, .tiocmset = cp2101_tiocmset, .attach = cp2101_startup, - .shutdown = cp2101_shutdown, + .disconnect = cp2101_disconnect, };/* Config request types */
@@ -727,7 +727,7 @@ static int cp2101_startup(struct usb_serial *serial)return 0 ; } -static void cp2101_shutdown (struct usb_serial *serial) +static void cp2101_disconnect (struct usb_serial *serial) {int i;
drivers/usb/serial/cyberjack.c +15 -5
@@ -58,7 +58,8 @@ static int debug;/* Function prototypes */ static int cyberjack_startup (struct usb_serial *serial); -static void cyberjack_shutdown (struct usb_serial *serial); +static void cyberjack_disconnect (struct usb_serial *serial); +static void cyberjack_release (struct usb_serial *serial);static int cyberjack_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void cyberjack_close(struct tty_struct *tty,
@@ -95,7 +96,8 @@ static struct usb_serial_driver cyberjack_device = { .id_table = id_table, .num_ports = 1, .attach = cyberjack_startup, - .shutdown = cyberjack_shutdown, + .disconnect = cyberjack_disconnect, + .release = cyberjack_release, .open = cyberjack_open, .close = cyberjack_close, .write = cyberjack_write,
@@ -148,17 +150,25 @@ static int cyberjack_startup(struct usb_serial *serial)return 0 ; } -static void cyberjack_shutdown (struct usb_serial *serial) +static void cyberjack_disconnect (struct usb_serial *serial) {int i;dbg ("%s" , __func__); -for (i =0 ; i < serial->num_ports; ++i) { +for (i =0 ; i < serial->num_ports; ++i)usb_kill_urb (serial->port[i]->interrupt_in_urb); +} + +static void cyberjack_release (struct usb_serial *serial) +{ +int i; + +dbg ("%s" , __func__); + +for (i =0 ; i < serial->num_ports; ++i) {/* My special items, the standard routines free my urbs */ kfree (usb_get_serial_port_data (serial->port[i])); -usb_set_serial_port_data (serial->port[i],NULL ); } }
drivers/usb/serial/cypress_m8.c +5 -6
@@ -171,7 +171,7 @@ struct cypress_buf {static int cypress_earthmate_startup (struct usb_serial *serial);static int cypress_hidcom_startup (struct usb_serial *serial);static int cypress_ca42v2_startup (struct usb_serial *serial); -static void cypress_shutdown (struct usb_serial *serial); +static void cypress_release (struct usb_serial *serial);static int cypress_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void cypress_close(struct tty_struct *tty,
@@ -215,7 +215,7 @@ static struct usb_serial_driver cypress_earthmate_device = { .id_table = id_table_earthmate, .num_ports = 1, .attach = cypress_earthmate_startup, - .shutdown = cypress_shutdown, + .release = cypress_release, .open = cypress_open, .close = cypress_close, .write = cypress_write,
@@ -241,7 +241,7 @@ static struct usb_serial_driver cypress_hidcom_device = { .id_table = id_table_cyphidcomrs232, .num_ports = 1, .attach = cypress_hidcom_startup, - .shutdown = cypress_shutdown, + .release = cypress_release, .open = cypress_open, .close = cypress_close, .write = cypress_write,
@@ -267,7 +267,7 @@ static struct usb_serial_driver cypress_ca42v2_device = { .id_table = id_table_nokiaca42v2, .num_ports = 1, .attach = cypress_ca42v2_startup, - .shutdown = cypress_shutdown, + .release = cypress_release, .open = cypress_open, .close = cypress_close, .write = cypress_write,
@@ -612,7 +612,7 @@ static int cypress_ca42v2_startup(struct usb_serial *serial) }/* cypress_ca42v2_startup */ -static void cypress_shutdown (struct usb_serial *serial) +static void cypress_release (struct usb_serial *serial) {struct cypress_private *priv;
@@ -625,7 +625,6 @@ static void cypress_shutdown(struct usb_serial *serial)if (priv) {cypress_buf_free (priv->buf);kfree (priv); -usb_set_serial_port_data (serial->port[0 ],NULL ); } }
drivers/usb/serial/digi_acceleport.c +15 -5
@@ -460,7 +460,8 @@ static void digi_close(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp);static int digi_startup_device (struct usb_serial *serial);static int digi_startup (struct usb_serial *serial); -static void digi_shutdown (struct usb_serial *serial); +static void digi_disconnect (struct usb_serial *serial); +static void digi_release (struct usb_serial *serial);static void digi_read_bulk_callback (struct urb *urb);static int digi_read_inb_callback (struct urb *urb);static int digi_read_oob_callback (struct urb *urb);
@@ -522,7 +523,8 @@ static struct usb_serial_driver digi_acceleport_2_device = { .tiocmget = digi_tiocmget, .tiocmset = digi_tiocmset, .attach = digi_startup, - .shutdown = digi_shutdown, + .disconnect = digi_disconnect, + .release = digi_release, };static struct usb_serial_driver digi_acceleport_4_device = {
@@ -548,7 +550,8 @@ static struct usb_serial_driver digi_acceleport_4_device = { .tiocmget = digi_tiocmget, .tiocmset = digi_tiocmset, .attach = digi_startup, - .shutdown = digi_shutdown, + .disconnect = digi_disconnect, + .release = digi_release, };
@@ -1586,16 +1589,23 @@ static int digi_startup(struct usb_serial *serial) } -static void digi_shutdown (struct usb_serial *serial) +static void digi_disconnect (struct usb_serial *serial) {int i; -dbg ("digi_shutdown: TOP, in_interrupt()=%ld" ,in_interrupt ()); +dbg ("digi_disconnect: TOP, in_interrupt()=%ld" ,in_interrupt ());/* stop reads and writes on all ports */ for (i =0 ; i < serial->type->num_ports +1 ; i++) {usb_kill_urb (serial->port[i]->read_urb);usb_kill_urb (serial->port[i]->write_urb); } +} + + +static void digi_release (struct usb_serial *serial) +{ +int i; +dbg ("digi_release: TOP, in_interrupt()=%ld" ,in_interrupt ());/* free the private data structures for all ports */ /* number of regular ports + 1 for the out-of-band port */
drivers/usb/serial/empeg.c +0 -8
@@ -92,7 +92,6 @@ static int empeg_chars_in_buffer(struct tty_struct *tty);static void empeg_throttle (struct tty_struct *tty);static void empeg_unthrottle (struct tty_struct *tty);static int empeg_startup (struct usb_serial *serial); -static void empeg_shutdown (struct usb_serial *serial);static void empeg_set_termios (struct tty_struct *tty,struct usb_serial_port *port,struct ktermios *old_termios);static void empeg_write_bulk_callback (struct urb *urb);
@@ -126,7 +125,6 @@ static struct usb_serial_driver empeg_device = { .throttle = empeg_throttle, .unthrottle = empeg_unthrottle, .attach = empeg_startup, - .shutdown = empeg_shutdown, .set_termios = empeg_set_termios, .write = empeg_write, .write_room = empeg_write_room,
@@ -429,12 +427,6 @@ static int empeg_startup(struct usb_serial *serial) } -static void empeg_shutdown (struct usb_serial *serial) -{ -dbg ("%s" , __func__); -} - -static void empeg_set_termios (struct tty_struct *tty,struct usb_serial_port *port,struct ktermios *old_termios) {
drivers/usb/serial/ftdi_sio.c +0 -14
@@ -708,7 +708,6 @@ static const char *ftdi_chip_name[] = {/* function prototypes for a FTDI serial converter */ static int ftdi_sio_probe (struct usb_serial *serial,const struct usb_device_id *id); -static void ftdi_shutdown (struct usb_serial *serial);static int ftdi_sio_port_probe (struct usb_serial_port *port);static int ftdi_sio_port_remove (struct usb_serial_port *port); static int ftdi_open(struct tty_struct *tty,
@@ -764,7 +763,6 @@ static struct usb_serial_driver ftdi_sio_device = { .ioctl = ftdi_ioctl, .set_termios = ftdi_set_termios, .break_ctl = ftdi_break_ctl, - .shutdown = ftdi_shutdown, };
@@ -1442,18 +1440,6 @@ static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)return 0 ; } -/* ftdi_shutdown is called from usbserial:usb_serial_disconnect -* it is called when the usb device is disconnected -* -* usbserial:usb_serial_disconnect -* calls __serial_close for each open of the port -* shutdown is called then (ie ftdi_shutdown) -*/ -static void ftdi_shutdown (struct usb_serial *serial) -{ -dbg ("%s" , __func__); -} -static int ftdi_sio_port_remove (struct usb_serial_port *port) {struct ftdi_private *priv =usb_get_serial_port_data (port);
drivers/usb/serial/garmin_gps.c +13 -3
@@ -1527,7 +1527,7 @@ static int garmin_attach(struct usb_serial *serial) } -static void garmin_shutdown (struct usb_serial *serial) +static void garmin_disconnect (struct usb_serial *serial) {struct usb_serial_port *port = serial->port[0 ];struct garmin_data *garmin_data_p =usb_get_serial_port_data (port);
@@ -1536,8 +1536,17 @@ static void garmin_shutdown(struct usb_serial *serial)usb_kill_urb (port->interrupt_in_urb);del_timer_sync (&garmin_data_p->timer); +} + + +static void garmin_release (struct usb_serial *serial) +{ +struct usb_serial_port *port = serial->port[0 ]; +struct garmin_data *garmin_data_p =usb_get_serial_port_data (port); + +dbg ("%s" , __func__); +kfree (garmin_data_p); -usb_set_serial_port_data (port,NULL ); }
@@ -1556,7 +1565,8 @@ static struct usb_serial_driver garmin_device = { .throttle = garmin_throttle, .unthrottle = garmin_unthrottle, .attach = garmin_attach, - .shutdown = garmin_shutdown, + .disconnect = garmin_disconnect, + .release = garmin_release, .write = garmin_write, .write_room = garmin_write_room, .write_bulk_callback = garmin_write_bulk_callback,
drivers/usb/serial/generic.c +7 -2
@@ -63,7 +63,8 @@ struct usb_serial_driver usb_serial_generic_device = { .id_table = generic_device_ids, .usb_driver = &generic_driver, .num_ports = 1, - .shutdown = usb_serial_generic_shutdown, + .disconnect = usb_serial_generic_disconnect, + .release = usb_serial_generic_release, .throttle = usb_serial_generic_throttle, .unthrottle = usb_serial_generic_unthrottle, .resume = usb_serial_generic_resume,
@@ -419,7 +420,7 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty) } } -void usb_serial_generic_shutdown (struct usb_serial *serial) +void usb_serial_generic_disconnect (struct usb_serial *serial) {int i;
@@ -430,3 +431,7 @@ void usb_serial_generic_shutdown(struct usb_serial *serial)generic_cleanup (serial->port[i]); } +void usb_serial_generic_release (struct usb_serial *serial) +{ +dbg ("%s" , __func__); +}
drivers/usb/serial/io_edgeport.c +20 -9
@@ -225,7 +225,8 @@ static int edge_tiocmget(struct tty_struct *tty, struct file *file);static int edge_tiocmset (struct tty_struct *tty,struct file *file,unsigned int set,unsigned int clear);static int edge_startup (struct usb_serial *serial); -static void edge_shutdown (struct usb_serial *serial); +static void edge_disconnect (struct usb_serial *serial); +static void edge_release (struct usb_serial *serial);#include "io_tables.h" /* all of the devices that this driver supports */
@@ -3178,21 +3179,16 @@ static int edge_startup(struct usb_serial *serial)/**************************************************************************** -* edge_shutdown +* edge_disconnect * This function is called whenever the device is removed from the usb bus. ****************************************************************************/ -static void edge_shutdown (struct usb_serial *serial) +static void edge_disconnect (struct usb_serial *serial) {struct edgeport_serial *edge_serial =usb_get_serial_data (serial); -int i;dbg ("%s" , __func__);/* stop reads and writes on all ports */ -for (i =0 ; i < serial->num_ports; ++i) { -kfree (usb_get_serial_port_data (serial->port[i])); -usb_set_serial_port_data (serial->port[i],NULL ); - }/* free up our endpoint stuff */ if (edge_serial->is_epic) {usb_kill_urb (edge_serial->interrupt_read_urb);
@@ -3203,9 +3199,24 @@ static void edge_shutdown(struct usb_serial *serial)usb_free_urb (edge_serial->read_urb);kfree (edge_serial->bulk_in_buffer); } +} + + +/**************************************************************************** +* edge_release +* This function is called when the device structure is deallocated. +****************************************************************************/ +static void edge_release (struct usb_serial *serial) +{ +struct edgeport_serial *edge_serial =usb_get_serial_data (serial); +int i; + +dbg ("%s" , __func__); + +for (i =0 ; i < serial->num_ports; ++i) +kfree (usb_get_serial_port_data (serial->port[i]));kfree (edge_serial); -usb_set_serial_data (serial,NULL ); }
drivers/usb/serial/io_tables.h +8 -4
@@ -117,7 +117,8 @@ static struct usb_serial_driver edgeport_2port_device = { .throttle = edge_throttle, .unthrottle = edge_unthrottle, .attach = edge_startup, - .shutdown = edge_shutdown, + .disconnect = edge_disconnect, + .release = edge_release, .ioctl = edge_ioctl, .set_termios = edge_set_termios, .tiocmget = edge_tiocmget,
@@ -145,7 +146,8 @@ static struct usb_serial_driver edgeport_4port_device = { .throttle = edge_throttle, .unthrottle = edge_unthrottle, .attach = edge_startup, - .shutdown = edge_shutdown, + .disconnect = edge_disconnect, + .release = edge_release, .ioctl = edge_ioctl, .set_termios = edge_set_termios, .tiocmget = edge_tiocmget,
@@ -173,7 +175,8 @@ static struct usb_serial_driver edgeport_8port_device = { .throttle = edge_throttle, .unthrottle = edge_unthrottle, .attach = edge_startup, - .shutdown = edge_shutdown, + .disconnect = edge_disconnect, + .release = edge_release, .ioctl = edge_ioctl, .set_termios = edge_set_termios, .tiocmget = edge_tiocmget,
@@ -200,7 +203,8 @@ static struct usb_serial_driver epic_device = { .throttle = edge_throttle, .unthrottle = edge_unthrottle, .attach = edge_startup, - .shutdown = edge_shutdown, + .disconnect = edge_disconnect, + .release = edge_release, .ioctl = edge_ioctl, .set_termios = edge_set_termios, .tiocmget = edge_tiocmget,
drivers/usb/serial/io_ti.c +17 -5
@@ -2652,7 +2652,7 @@ cleanup:return -ENOMEM ; } -static void edge_shutdown (struct usb_serial *serial) +static void edge_disconnect (struct usb_serial *serial) {int i;struct edgeport_port *edge_port;
@@ -2662,12 +2662,22 @@ static void edge_shutdown(struct usb_serial *serial)for (i =0 ; i < serial->num_ports; ++i) { edge_port =usb_get_serial_port_data (serial->port[i]);edge_remove_sysfs_attrs (edge_port->port); + } +} + +static void edge_release (struct usb_serial *serial) +{ +int i; +struct edgeport_port *edge_port; + +dbg ("%s" , __func__); + +for (i =0 ; i < serial->num_ports; ++i) { + edge_port =usb_get_serial_port_data (serial->port[i]);edge_buf_free (edge_port->ep_out_buf);kfree (edge_port); -usb_set_serial_port_data (serial->port[i],NULL ); }kfree (usb_get_serial_data (serial)); -usb_set_serial_data (serial,NULL ); }
@@ -2904,7 +2914,8 @@ static struct usb_serial_driver edgeport_1port_device = { .throttle = edge_throttle, .unthrottle = edge_unthrottle, .attach = edge_startup, - .shutdown = edge_shutdown, + .disconnect = edge_disconnect, + .release = edge_release, .port_probe = edge_create_sysfs_attrs, .ioctl = edge_ioctl, .set_termios = edge_set_termios,
@@ -2933,7 +2944,8 @@ static struct usb_serial_driver edgeport_2port_device = { .throttle = edge_throttle, .unthrottle = edge_unthrottle, .attach = edge_startup, - .shutdown = edge_shutdown, + .disconnect = edge_disconnect, + .release = edge_release, .port_probe = edge_create_sysfs_attrs, .ioctl = edge_ioctl, .set_termios = edge_set_termios,
drivers/usb/serial/ipaq.c +0 -7
@@ -79,7 +79,6 @@ static int ipaq_open(struct tty_struct *tty,static void ipaq_close (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp);static int ipaq_startup (struct usb_serial *serial); -static void ipaq_shutdown (struct usb_serial *serial);static int ipaq_write (struct tty_struct *tty,struct usb_serial_port *port,const unsigned char *buf,int count); static int ipaq_write_bulk(struct usb_serial_port *port,
@@ -581,7 +580,6 @@ static struct usb_serial_driver ipaq_device = { .open = ipaq_open, .close = ipaq_close, .attach = ipaq_startup, - .shutdown = ipaq_shutdown, .write = ipaq_write, .write_room = ipaq_write_room, .chars_in_buffer = ipaq_chars_in_buffer,
@@ -957,11 +955,6 @@ static int ipaq_startup(struct usb_serial *serial)return usb_reset_configuration (serial->dev); } -static void ipaq_shutdown (struct usb_serial *serial) -{ -dbg ("%s" , __func__); -} -static int __init ipaq_init (void ) {int retval;
drivers/usb/serial/iuu_phoenix.c +3 -3
@@ -122,8 +122,8 @@ static int iuu_startup(struct usb_serial *serial)return 0 ; } -/* Shutdown function */ -static void iuu_shutdown (struct usb_serial *serial) +/* Release function */ +static void iuu_release (struct usb_serial *serial) {struct usb_serial_port *port = serial->port[0 ];struct iuu_private *priv =usb_get_serial_port_data (port);
@@ -1171,7 +1171,7 @@ static struct usb_serial_driver iuu_device = { .tiocmget = iuu_tiocmget, .tiocmset = iuu_tiocmset, .attach = iuu_startup, - .shutdown = iuu_shutdown, + .release = iuu_release, };static int __init iuu_init (void )
drivers/usb/serial/keyspan.c +12 -1
@@ -2678,7 +2678,7 @@ static int keyspan_startup(struct usb_serial *serial)return 0 ; } -static void keyspan_shutdown (struct usb_serial *serial) +static void keyspan_disconnect (struct usb_serial *serial) {int i, j;struct usb_serial_port *port;
@@ -2718,6 +2718,17 @@ static void keyspan_shutdown(struct usb_serial *serial)usb_free_urb (p_priv->out_urbs[j]); } } +} + +static void keyspan_release (struct usb_serial *serial) +{ +int i; +struct usb_serial_port *port; +struct keyspan_serial_private *s_priv; + +dbg ("%s" , __func__); + + s_priv =usb_get_serial_data (serial);/* dbg("Freeing serial->private."); */ kfree (s_priv);
drivers/usb/serial/keyspan.h +8 -4
@@ -42,7 +42,8 @@ static void keyspan_close (struct tty_struct *tty,struct usb_serial_port *port, struct file *filp);static int keyspan_startup (struct usb_serial *serial); -static void keyspan_shutdown (struct usb_serial *serial); +static void keyspan_disconnect (struct usb_serial *serial); +static void keyspan_release (struct usb_serial *serial);static int keyspan_write_room (struct tty_struct *tty); static int keyspan_write (struct tty_struct *tty,
@@ -569,7 +570,8 @@ static struct usb_serial_driver keyspan_1port_device = { .tiocmget = keyspan_tiocmget, .tiocmset = keyspan_tiocmset, .attach = keyspan_startup, - .shutdown = keyspan_shutdown, + .disconnect = keyspan_disconnect, + .release = keyspan_release, };static struct usb_serial_driver keyspan_2port_device = {
@@ -589,7 +591,8 @@ static struct usb_serial_driver keyspan_2port_device = { .tiocmget = keyspan_tiocmget, .tiocmset = keyspan_tiocmset, .attach = keyspan_startup, - .shutdown = keyspan_shutdown, + .disconnect = keyspan_disconnect, + .release = keyspan_release, };static struct usb_serial_driver keyspan_4port_device = {
@@ -609,7 +612,8 @@ static struct usb_serial_driver keyspan_4port_device = { .tiocmget = keyspan_tiocmget, .tiocmset = keyspan_tiocmset, .attach = keyspan_startup, - .shutdown = keyspan_shutdown, + .disconnect = keyspan_disconnect, + .release = keyspan_release, };#endif
drivers/usb/serial/keyspan_pda.c +2 -2
@@ -789,7 +789,7 @@ static int keyspan_pda_startup(struct usb_serial *serial)return 0 ; } -static void keyspan_pda_shutdown (struct usb_serial *serial) +static void keyspan_pda_release (struct usb_serial *serial) {dbg ("%s" , __func__);
@@ -847,7 +847,7 @@ static struct usb_serial_driver keyspan_pda_device = { .tiocmget = keyspan_pda_tiocmget, .tiocmset = keyspan_pda_tiocmset, .attach = keyspan_pda_startup, - .shutdown = keyspan_pda_shutdown, + .release = keyspan_pda_release, };
drivers/usb/serial/kl5kusb105.c +22 -17
@@ -73,7 +73,8 @@ static int debug;* Function prototypes */ static int klsi_105_startup (struct usb_serial *serial); -static void klsi_105_shutdown (struct usb_serial *serial); +static void klsi_105_disconnect (struct usb_serial *serial); +static void klsi_105_release (struct usb_serial *serial);static int klsi_105_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void klsi_105_close(struct tty_struct *tty,
@@ -132,7 +133,8 @@ static struct usb_serial_driver kl5kusb105d_device = { .tiocmget = klsi_105_tiocmget, .tiocmset = klsi_105_tiocmset, .attach = klsi_105_startup, - .shutdown = klsi_105_shutdown, + .disconnect = klsi_105_disconnect, + .release = klsi_105_release, .throttle = klsi_105_throttle, .unthrottle = klsi_105_unthrottle, };
@@ -314,7 +316,7 @@ err_cleanup: }/* klsi_105_startup */ -static void klsi_105_shutdown (struct usb_serial *serial) +static void klsi_105_disconnect (struct usb_serial *serial) {int i;
@@ -324,33 +326,36 @@ static void klsi_105_shutdown(struct usb_serial *serial)for (i =0 ; i < serial->num_ports; ++i) {struct klsi_105_private *priv =usb_get_serial_port_data (serial->port[i]); -unsigned long flags;if (priv) {/* kill our write urb pool */ int j;struct urb **write_urbs = priv->write_urb_pool; -spin_lock_irqsave (&priv->lock, flags);for (j =0 ; j <NUM_URBS ; j++) {if (write_urbs[j]) { -/* FIXME - uncomment the following -* usb_kill_urb call when the host -* controllers get fixed to set -* urb->dev = NULL after the urb is -* finished. Otherwise this call -* oopses. */ -/* usb_kill_urb(write_urbs[j]); */ -kfree (write_urbs[j]->transfer_buffer); +usb_kill_urb (write_urbs[j]);usb_free_urb (write_urbs[j]); } } -spin_unlock_irqrestore (&priv->lock, flags); -kfree (priv); -usb_set_serial_port_data (serial->port[i],NULL ); } } -}/* klsi_105_shutdown */ +}/* klsi_105_disconnect */ + + +static void klsi_105_release (struct usb_serial *serial) +{ +int i; + +dbg ("%s" , __func__); + +for (i =0 ; i < serial->num_ports; ++i) { +struct klsi_105_private *priv = +usb_get_serial_port_data (serial->port[i]); + +kfree (priv); + } +}/* klsi_105_release */ static int klsi_105_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp)
drivers/usb/serial/kobil_sct.c +4 -8
@@ -69,7 +69,7 @@ static int debug;/* Function prototypes */ static int kobil_startup (struct usb_serial *serial); -static void kobil_shutdown (struct usb_serial *serial); +static void kobil_release (struct usb_serial *serial);static int kobil_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void kobil_close(struct tty_struct *tty, struct usb_serial_port *port,
@@ -118,7 +118,7 @@ static struct usb_serial_driver kobil_device = { .id_table = id_table, .num_ports = 1, .attach = kobil_startup, - .shutdown = kobil_shutdown, + .release = kobil_release, .ioctl = kobil_ioctl, .set_termios = kobil_set_termios, .tiocmget = kobil_tiocmget,
@@ -202,17 +202,13 @@ static int kobil_startup(struct usb_serial *serial) } -static void kobil_shutdown (struct usb_serial *serial) +static void kobil_release (struct usb_serial *serial) {int i;dbg ("%s - port %d" , __func__, serial->port[0 ]->number); -for (i =0 ; i < serial->num_ports; ++i) { -while (serial->port[i]->port.count >0 ) -kobil_close (NULL , serial->port[i],NULL ); +for (i =0 ; i < serial->num_ports; ++i)kfree (usb_get_serial_port_data (serial->port[i])); -usb_set_serial_port_data (serial->port[i],NULL ); - } }
drivers/usb/serial/mct_u232.c +5 -8
@@ -92,7 +92,7 @@ static int debug;* Function prototypes */ static int mct_u232_startup (struct usb_serial *serial); -static void mct_u232_shutdown (struct usb_serial *serial); +static void mct_u232_release (struct usb_serial *serial);static int mct_u232_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void mct_u232_close(struct tty_struct *tty,
@@ -148,7 +148,7 @@ static struct usb_serial_driver mct_u232_device = { .tiocmget = mct_u232_tiocmget, .tiocmset = mct_u232_tiocmset, .attach = mct_u232_startup, - .shutdown = mct_u232_shutdown, + .release = mct_u232_release, };
@@ -401,7 +401,7 @@ static int mct_u232_startup(struct usb_serial *serial) }/* mct_u232_startup */ -static void mct_u232_shutdown (struct usb_serial *serial) +static void mct_u232_release (struct usb_serial *serial) {struct mct_u232_private *priv;int i;
@@ -411,12 +411,9 @@ static void mct_u232_shutdown(struct usb_serial *serial)for (i =0 ; i < serial->num_ports; ++i) {/* My special items, the standard routines free my urbs */ priv =usb_get_serial_port_data (serial->port[i]); -if (priv) { -usb_set_serial_port_data (serial->port[i],NULL ); -kfree (priv); - } +kfree (priv); } -}/* mct_u232_shutdown */ +}/* mct_u232_release */ static int mct_u232_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp)
drivers/usb/serial/mos7720.c +3 -6
@@ -1547,19 +1547,16 @@ static int mos7720_startup(struct usb_serial *serial)return 0 ; } -static void mos7720_shutdown (struct usb_serial *serial) +static void mos7720_release (struct usb_serial *serial) {int i;/* free private structure allocated for serial port */ -for (i =0 ; i < serial->num_ports; ++i) { +for (i =0 ; i < serial->num_ports; ++i)kfree (usb_get_serial_port_data (serial->port[i])); -usb_set_serial_port_data (serial->port[i],NULL ); - }/* free private structure allocated for serial device */ kfree (usb_get_serial_data (serial)); -usb_set_serial_data (serial,NULL ); }static struct usb_driver usb_driver = {
@@ -1584,7 +1581,7 @@ static struct usb_serial_driver moschip7720_2port_driver = { .throttle = mos7720_throttle, .unthrottle = mos7720_unthrottle, .attach = mos7720_startup, - .shutdown = mos7720_shutdown, + .release = mos7720_release, .ioctl = mos7720_ioctl, .set_termios = mos7720_set_termios, .write = mos7720_write,
drivers/usb/serial/mos7840.c +40 -8
73 lines not on this page · raw message
drivers/usb/serial/omninet.c +15 -4
@@ -73,7 +73,8 @@ static void omninet_write_bulk_callback(struct urb *urb);static int omninet_write (struct tty_struct *tty,struct usb_serial_port *port,const unsigned char *buf,int count);static int omninet_write_room (struct tty_struct *tty); -static void omninet_shutdown (struct usb_serial *serial); +static void omninet_disconnect (struct usb_serial *serial); +static void omninet_release (struct usb_serial *serial);static int omninet_attach (struct usb_serial *serial);static struct usb_device_id id_table[] = {
@@ -109,7 +110,8 @@ static struct usb_serial_driver zyxel_omninet_device = { .write_room = omninet_write_room, .read_bulk_callback = omninet_read_bulk_callback, .write_bulk_callback = omninet_write_bulk_callback, - .shutdown = omninet_shutdown, + .disconnect = omninet_disconnect, + .release = omninet_release, };
@@ -342,13 +344,22 @@ static void omninet_write_bulk_callback(struct urb *urb) } -static void omninet_shutdown (struct usb_serial *serial) +static void omninet_disconnect (struct usb_serial *serial) {struct usb_serial_port *wport = serial->port[1 ]; -struct usb_serial_port *port = serial->port[0 ]; +dbg ("%s" , __func__);usb_kill_urb (wport->write_urb); +} + + +static void omninet_release (struct usb_serial *serial) +{ +struct usb_serial_port *port = serial->port[0 ]; + +dbg ("%s" , __func__); +kfree (usb_get_serial_port_data (port)); }
drivers/usb/serial/option.c +89 -8
159 lines not on this page · raw message
drivers/usb/serial/oti6858.c +3 -4
@@ -160,7 +160,7 @@ static int oti6858_tiocmget(struct tty_struct *tty, struct file *file);static int oti6858_tiocmset (struct tty_struct *tty,struct file *file,unsigned int set,unsigned int clear);static int oti6858_startup (struct usb_serial *serial); -static void oti6858_shutdown (struct usb_serial *serial); +static void oti6858_release (struct usb_serial *serial);/* functions operating on buffers */ static struct oti6858_buf *oti6858_buf_alloc (unsigned int size);
@@ -195,7 +195,7 @@ static struct usb_serial_driver oti6858_device = { .write_room = oti6858_write_room, .chars_in_buffer = oti6858_chars_in_buffer, .attach = oti6858_startup, - .shutdown = oti6858_shutdown, + .release = oti6858_release, };struct oti6858_private {
@@ -833,7 +833,7 @@ static int oti6858_ioctl(struct tty_struct *tty, struct file *file, } -static void oti6858_shutdown (struct usb_serial *serial) +static void oti6858_release (struct usb_serial *serial) {struct oti6858_private *priv;int i;
@@ -845,7 +845,6 @@ static void oti6858_shutdown(struct usb_serial *serial)if (priv) {oti6858_buf_free (priv->buf);kfree (priv); -usb_set_serial_port_data (serial->port[i],NULL ); } } }
drivers/usb/serial/pl2303.c +2 -3
@@ -905,7 +905,7 @@ static void pl2303_break_ctl(struct tty_struct *tty, int break_state)dbg ("%s - error sending break = %d" , __func__, result); } -static void pl2303_shutdown (struct usb_serial *serial) +static void pl2303_release (struct usb_serial *serial) {int i;struct pl2303_private *priv;
@@ -917,7 +917,6 @@ static void pl2303_shutdown(struct usb_serial *serial)if (priv) {pl2303_buf_free (priv->buf);kfree (priv); -usb_set_serial_port_data (serial->port[i],NULL ); } } }
@@ -1145,7 +1144,7 @@ static struct usb_serial_driver pl2303_device = { .write_room = pl2303_write_room, .chars_in_buffer = pl2303_chars_in_buffer, .attach = pl2303_startup, - .shutdown = pl2303_shutdown, + .release = pl2303_release, };static int __init pl2303_init (void )
drivers/usb/serial/sierra.c +24 -4
@@ -677,7 +677,7 @@ static int sierra_startup(struct usb_serial *serial)return 0 ; } -static void sierra_shutdown (struct usb_serial *serial) +static void sierra_disconnect (struct usb_serial *serial) {int i, j;struct usb_serial_port *port;
@@ -696,10 +696,29 @@ static void sierra_shutdown(struct usb_serial *serial)for (j =0 ; j <N_IN_URB ; j++) {usb_kill_urb (portdata->in_urbs[j]);usb_free_urb (portdata->in_urbs[j]); -kfree (portdata->in_buffer[j]); } + } +} + +static void sierra_release (struct usb_serial *serial) +{ +int i, j; +struct usb_serial_port *port; +struct sierra_port_private *portdata; + +dev_dbg (&serial->dev->dev,"%s\n" , __func__); + +for (i =0 ; i < serial->num_ports; ++i) { + port = serial->port[i]; +if (!port) +continue ; + portdata =usb_get_serial_port_data (port); +if (!portdata) +continue ; + +for (j =0 ; j <N_IN_URB ; j++) +kfree (portdata->in_buffer[j]);kfree (portdata); -usb_set_serial_port_data (port,NULL ); } }
@@ -721,7 +740,8 @@ static struct usb_serial_driver sierra_device = { .tiocmget = sierra_tiocmget, .tiocmset = sierra_tiocmset, .attach = sierra_startup, - .shutdown = sierra_shutdown, + .disconnect = sierra_disconnect, + .release = sierra_release, .read_int_callback = sierra_instat_callback, };
drivers/usb/serial/spcp8x5.c +2 -3
@@ -356,7 +356,7 @@ cleanup: }/* call when the device plug out. free all the memory alloced by probe */ -static void spcp8x5_shutdown (struct usb_serial *serial) +static void spcp8x5_release (struct usb_serial *serial) {int i;struct spcp8x5_private *priv;
@@ -366,7 +366,6 @@ static void spcp8x5_shutdown(struct usb_serial *serial)if (priv) {free_ringbuf (priv->buf);kfree (priv); -usb_set_serial_port_data (serial->port[i] ,NULL ); } } }
@@ -1041,7 +1040,7 @@ static struct usb_serial_driver spcp8x5_device = { .write_bulk_callback = spcp8x5_write_bulk_callback, .chars_in_buffer = spcp8x5_chars_in_buffer, .attach = spcp8x5_startup, - .shutdown = spcp8x5_shutdown, + .release = spcp8x5_release, };static int __init spcp8x5_init (void )
drivers/usb/serial/ti_usb_3410_5052.c +4 -6
@@ -148,7 +148,7 @@ struct ti_device {/* Function Declarations */ static int ti_startup (struct usb_serial *serial); -static void ti_shutdown (struct usb_serial *serial); +static void ti_release (struct usb_serial *serial);static int ti_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *file); static void ti_close(struct tty_struct *tty, struct usb_serial_port *port,
@@ -271,7 +271,7 @@ static struct usb_serial_driver ti_1port_device = { .id_table = ti_id_table_3410, .num_ports = 1, .attach = ti_startup, - .shutdown = ti_shutdown, + .release = ti_release, .open = ti_open, .close = ti_close, .write = ti_write,
@@ -299,7 +299,7 @@ static struct usb_serial_driver ti_2port_device = { .id_table = ti_id_table_5052, .num_ports = 2, .attach = ti_startup, - .shutdown = ti_shutdown, + .release = ti_release, .open = ti_open, .close = ti_close, .write = ti_write,
@@ -506,7 +506,7 @@ free_tdev: } -static void ti_shutdown (struct usb_serial *serial) +static void ti_release (struct usb_serial *serial) {int i;struct ti_device *tdev =usb_get_serial_data (serial);
@@ -519,12 +519,10 @@ static void ti_shutdown(struct usb_serial *serial)if (tport) {ti_buf_free (tport->tp_write_buf);kfree (tport); -usb_set_serial_port_data (serial->port[i],NULL ); } }kfree (tdev); -usb_set_serial_data (serial,NULL ); }
drivers/usb/serial/usb-serial.c +13 -16
@@ -140,6 +140,14 @@ static void destroy_serial(struct kref *kref)if (serial->minor !=SERIAL_TTY_NO_MINOR )return_serial (serial); + serial->type->release (serial); + +for (i =0 ; i < serial->num_ports; ++i) { + port = serial->port[i]; +if (port) +put_device (&port->dev); + } +/* If this is a "fake" port, we have to clean it up here, as it will * not get cleaned up in port_release() as it was never registered with * the driver core */
@@ -147,9 +155,8 @@ static void destroy_serial(struct kref *kref)for (i = serial->num_ports; i < serial->num_port_pointers; ++i) { port = serial->port[i]; -if (!port) -continue ; -port_free (port); +if (port) +port_free (port); } }
@@ -1061,10 +1068,6 @@ void usb_serial_disconnect(struct usb_interface *interface) serial->disconnected =1 ;mutex_unlock (&serial->disc_mutex); -/* Unfortunately, many of the sub-drivers expect the port structures -* to exist when their shutdown method is called, so we have to go -* through this awkward two-step unregistration procedure. -*/ for (i =0 ; i < serial->num_ports; ++i) { port = serial->port[i];if (port) {
@@ -1075,14 +1078,7 @@ void usb_serial_disconnect(struct usb_interface *interface)device_del (&port->dev); } } - serial->type->shutdown (serial); -for (i =0 ; i < serial->num_ports; ++i) { - port = serial->port[i]; -if (port) { -put_device (&port->dev); - serial->port[i] =NULL ; - } - } + serial->type->disconnect (serial);/* let the last holder of this object * cause it to be cleaned up */
@@ -1246,7 +1242,8 @@ static void fixup_generic(struct usb_serial_driver *device)set_to_generic_if_null (device, chars_in_buffer);set_to_generic_if_null (device, read_bulk_callback);set_to_generic_if_null (device, write_bulk_callback); -set_to_generic_if_null (device, shutdown); +set_to_generic_if_null (device, disconnect); +set_to_generic_if_null (device, release);set_to_generic_if_null (device, resume); }
drivers/usb/serial/visor.c +5 -8
@@ -48,7 +48,7 @@ static void visor_unthrottle(struct tty_struct *tty);static int visor_probe (struct usb_serial *serial,const struct usb_device_id *id);static int visor_calc_num_ports (struct usb_serial *serial); -static void visor_shutdown (struct usb_serial *serial); +static void visor_release (struct usb_serial *serial);static void visor_write_bulk_callback (struct urb *urb);static void visor_read_bulk_callback (struct urb *urb);static void visor_read_int_callback (struct urb *urb);
@@ -203,7 +203,7 @@ static struct usb_serial_driver handspring_device = { .attach = treo_attach, .probe = visor_probe, .calc_num_ports = visor_calc_num_ports, - .shutdown = visor_shutdown, + .release = visor_release, .write = visor_write, .write_room = visor_write_room, .write_bulk_callback = visor_write_bulk_callback,
@@ -228,7 +228,7 @@ static struct usb_serial_driver clie_5_device = { .attach = clie_5_attach, .probe = visor_probe, .calc_num_ports = visor_calc_num_ports, - .shutdown = visor_shutdown, + .release = visor_release, .write = visor_write, .write_room = visor_write_room, .write_bulk_callback = visor_write_bulk_callback,
@@ -916,7 +916,7 @@ static int clie_5_attach(struct usb_serial *serial)return generic_startup (serial); } -static void visor_shutdown (struct usb_serial *serial) +static void visor_release (struct usb_serial *serial) {struct visor_private *priv;int i;
@@ -925,10 +925,7 @@ static void visor_shutdown(struct usb_serial *serial)for (i =0 ; i < serial->num_ports; i++) { priv =usb_get_serial_port_data (serial->port[i]); -if (priv) { -usb_set_serial_port_data (serial->port[i],NULL ); -kfree (priv); - } +kfree (priv); } }
drivers/usb/serial/whiteheat.c +3 -3
@@ -144,7 +144,7 @@ static int whiteheat_firmware_attach(struct usb_serial *serial);/* function prototypes for the Connect Tech WhiteHEAT serial converter */ static int whiteheat_attach (struct usb_serial *serial); -static void whiteheat_shutdown (struct usb_serial *serial); +static void whiteheat_release (struct usb_serial *serial);static int whiteheat_open (struct tty_struct *tty,struct usb_serial_port *port,struct file *filp); static void whiteheat_close(struct tty_struct *tty,
@@ -190,7 +190,7 @@ static struct usb_serial_driver whiteheat_device = { .id_table = id_table_std, .num_ports = 4, .attach = whiteheat_attach, - .shutdown = whiteheat_shutdown, + .release = whiteheat_release, .open = whiteheat_open, .close = whiteheat_close, .write = whiteheat_write,
@@ -600,7 +600,7 @@ no_command_buffer: } -static void whiteheat_shutdown (struct usb_serial *serial) +static void whiteheat_release (struct usb_serial *serial) {struct usb_serial_port *command_port;struct usb_serial_port *port;
fs/fuse/dir.c +3 -0
@@ -398,6 +398,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,if (fc->no_create)return -ENOSYS ; +if (flags &O_DIRECT ) +return -EINVAL ; + forget_req =fuse_get_req (fc);if (IS_ERR (forget_req))return PTR_ERR (forget_req);
fs/fuse/file.c +2 -1
@@ -1005,7 +1005,8 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf,break ; } } -fuse_put_request (fc, req); +if (!IS_ERR (req)) +fuse_put_request (fc, req);if (res >0 ) {if (write)fuse_write_update_size (inode, pos);
fs/jffs2/read.c +6 -3
@@ -164,12 +164,15 @@ int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,/* XXX FIXME: Where a single physical node actually shows up in two frags, we read it twice. Don't do that. */ -/* Now we're pointing at the first frag which overlaps our page */ +/* Now we're pointing at the first frag which overlaps our page +* (or perhaps is before it, if we've been asked to read off the +* end of the file). */ while (offset < end) {D2 (printk (KERN_DEBUG "jffs2_read_inode_range: offset %d, end %d\n" , offset, end)); -if (unlikely (!frag || frag->ofs > offset)) { +if (unlikely (!frag || frag->ofs > offset || + frag->ofs + frag->size <= offset)) {uint32_t holesize = end - offset; -if (frag) { +if (frag && frag->ofs > offset) {D1 (printk (KERN_NOTICE "Eep. Hole in ino #%u fraglist. frag->ofs = 0x%08x, offset = 0x%08x\n" , f->inocache->ino, frag->ofs, offset)); holesize =min (holesize, frag->ofs - offset); }
include/linux/usb/serial.h +8 -4
@@ -177,8 +177,10 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data)* This will be called when the struct usb_serial structure is fully set * set up. Do any local initialization of the device, or any private * memory structure allocation at this point in time. -* @shutdown: pointer to the driver's shutdown function. This will be -* called when the device is removed from the system. +* @disconnect: pointer to the driver's disconnect function. This will be +* called when the device is unplugged or unbound from the driver. +* @release: pointer to the driver's release function. This will be called +* when the usb_serial data structure is about to be destroyed. * @usb_driver: pointer to the struct usb_driver that controls this * device. This is necessary to allow dynamic ids to be added to * the driver from sysfs.
@@ -208,7 +210,8 @@ struct usb_serial_driver {int (*attach)(struct usb_serial *serial);int (*calc_num_ports) (struct usb_serial *serial); -void (*shutdown)(struct usb_serial *serial); +void (*disconnect)(struct usb_serial *serial); +void (*release)(struct usb_serial *serial);int (*port_probe)(struct usb_serial_port *port);int (*port_remove)(struct usb_serial_port *port);
@@ -288,7 +291,8 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb);extern void usb_serial_generic_write_bulk_callback (struct urb *urb);extern void usb_serial_generic_throttle (struct tty_struct *tty);extern void usb_serial_generic_unthrottle (struct tty_struct *tty); -extern void usb_serial_generic_shutdown (struct usb_serial *serial); +extern void usb_serial_generic_disconnect (struct usb_serial *serial); +extern void usb_serial_generic_release (struct usb_serial *serial);extern int usb_serial_generic_register (int debug);extern void usb_serial_generic_deregister (void );
sound/arm/aaci.c +5 -1
@@ -504,6 +504,10 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream,int err;aaci_pcm_hw_free (substream); +if (aacirun->pcm_open) { +snd_ac97_pcm_close (aacirun->pcm); + aacirun->pcm_open =0 ; + } err =devdma_hw_alloc (NULL , substream,params_buffer_bytes (params));
@@ -517,7 +521,7 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream,else err =snd_ac97_pcm_open (aacirun->pcm,params_rate (params),params_channels (params), - aacirun->pcm->r[1 ].slots); + aacirun->pcm->r[0 ].slots);if (err) goto out;
sound/usb/usbaudio.h +1 -1
@@ -209,7 +209,7 @@ struct snd_usb_midi_endpoint_info {/* */ -#define combine_word (s) ((*s) | ((unsigned int)(s)[1] << 8)) +#define combine_word (s) ((*(s)) | ((unsigned int)(s)[1] << 8))#define combine_triple (s) (combine_word(s) | ((unsigned int)(s)[2] << 16))#define combine_quad (s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))