mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
remove some patches
This commit is contained in:
parent
19cabc0840
commit
8d85a137f2
@ -1,25 +0,0 @@
|
||||
--- linux-2.6.16/drivers/media/video/saa7134/saa7134-cards.c 2006-03-20 13:53:29.000000000 +0800
|
||||
+++ linux-2.6.16/drivers/media/video/saa7134/saa7134-cards.c 2006-04-13 14:07:25.000000000 +0800
|
||||
@@ -2485,7 +2485,7 @@
|
||||
/* "Cyril Lacoux (Yack)" <clacoux@ifeelgood.org> */
|
||||
.name = "ASUS Digimatrix TV",
|
||||
.audio_clock = 0x00200000,
|
||||
- .tuner_type = TUNER_PHILIPS_FQ1216ME,
|
||||
+ .tuner_type = TUNER_LG_PAL_NEW_TAPC,
|
||||
.tda9887_conf = TDA9887_PRESENT,
|
||||
.radio_type = UNSET,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
@@ -2498,11 +2498,11 @@
|
||||
},{
|
||||
.name = name_comp1,
|
||||
.vmux = 3,
|
||||
- .amux = LINE1,
|
||||
+ .amux = LINE2,
|
||||
},{
|
||||
.name = name_svideo,
|
||||
.vmux = 8,
|
||||
- .amux = LINE1,
|
||||
+ .amux = LINE2
|
||||
}},
|
||||
},
|
||||
[SAA7134_BOARD_PHILIPS_TIGER] = {
|
@ -1,12 +0,0 @@
|
||||
diff -Nur linux-2.6.18.orig/drivers/net/via-rhine.c linux-2.6.18/drivers/net/via-rhine.c
|
||||
--- linux-2.6.18.orig/drivers/net/via-rhine.c 2006-09-17 16:41:59.000000000 +0200
|
||||
+++ linux-2.6.18/drivers/net/via-rhine.c 2006-09-17 16:43:30.000000000 +0200
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/* Work-around for broken BIOSes: they are unable to get the chip back out of
|
||||
power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
|
||||
-static int avoid_D3;
|
||||
+static int avoid_D3 = 1;
|
||||
|
||||
/*
|
||||
* In case you are looking for 'options[]' or 'full_duplex[]', they
|
@ -1,77 +0,0 @@
|
||||
diff -Naur linux-2.6.29.1/include/linux/dvb/audio.h linux-2.6.29.1a/include/linux/dvb/audio.h
|
||||
--- linux-2.6.29.1/include/linux/dvb/audio.h 2009-04-02 22:55:27.000000000 +0200
|
||||
+++ linux-2.6.29.1a/include/linux/dvb/audio.h 2009-04-14 14:13:04.000000000 +0200
|
||||
@@ -24,7 +24,12 @@
|
||||
#ifndef _DVBAUDIO_H_
|
||||
#define _DVBAUDIO_H_
|
||||
|
||||
+#ifdef __KERNEL__
|
||||
#include <linux/types.h>
|
||||
+#else
|
||||
+#include <stdint.h>
|
||||
+#endif
|
||||
+
|
||||
|
||||
typedef enum {
|
||||
AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
|
||||
diff -Naur linux-2.6.29.1/include/linux/dvb/dmx.h linux-2.6.29.1a/include/linux/dvb/dmx.h
|
||||
--- linux-2.6.29.1/include/linux/dvb/dmx.h 2009-04-02 22:55:27.000000000 +0200
|
||||
+++ linux-2.6.29.1a/include/linux/dvb/dmx.h 2009-04-14 14:13:04.000000000 +0200
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _DVBDMX_H_
|
||||
#define _DVBDMX_H_
|
||||
|
||||
-#include <linux/types.h>
|
||||
+#include <asm/types.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/time.h>
|
||||
#else
|
||||
diff -Naur linux-2.6.29.1/include/linux/dvb/frontend.h linux-2.6.29.1a/include/linux/dvb/frontend.h
|
||||
--- linux-2.6.29.1/include/linux/dvb/frontend.h 2009-04-02 22:55:27.000000000 +0200
|
||||
+++ linux-2.6.29.1a/include/linux/dvb/frontend.h 2009-04-14 14:13:04.000000000 +0200
|
||||
@@ -26,7 +26,8 @@
|
||||
#ifndef _DVBFRONTEND_H_
|
||||
#define _DVBFRONTEND_H_
|
||||
|
||||
-#include <linux/types.h>
|
||||
+#include <asm/types.h>
|
||||
+
|
||||
|
||||
typedef enum fe_type {
|
||||
FE_QPSK,
|
||||
diff -Naur linux-2.6.29.1/include/linux/dvb/net.h linux-2.6.29.1a/include/linux/dvb/net.h
|
||||
--- linux-2.6.29.1/include/linux/dvb/net.h 2009-04-02 22:55:27.000000000 +0200
|
||||
+++ linux-2.6.29.1a/include/linux/dvb/net.h 2009-04-14 14:13:04.000000000 +0200
|
||||
@@ -24,7 +24,8 @@
|
||||
#ifndef _DVBNET_H_
|
||||
#define _DVBNET_H_
|
||||
|
||||
-#include <linux/types.h>
|
||||
+#include <asm/types.h>
|
||||
+
|
||||
|
||||
struct dvb_net_if {
|
||||
__u16 pid;
|
||||
diff -Naur linux-2.6.29.1/include/linux/dvb/video.h linux-2.6.29.1a/include/linux/dvb/video.h
|
||||
--- linux-2.6.29.1/include/linux/dvb/video.h 2009-04-02 22:55:27.000000000 +0200
|
||||
+++ linux-2.6.29.1a/include/linux/dvb/video.h 2009-04-14 14:13:04.000000000 +0200
|
||||
@@ -24,14 +24,17 @@
|
||||
#ifndef _DVBVIDEO_H_
|
||||
#define _DVBVIDEO_H_
|
||||
|
||||
-#include <linux/types.h>
|
||||
-#ifdef __KERNEL__
|
||||
#include <linux/compiler.h>
|
||||
+
|
||||
+#ifdef __KERNEL__
|
||||
+#include <linux/types.h>
|
||||
#else
|
||||
+#include <asm/types.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
+
|
||||
typedef enum {
|
||||
VIDEO_FORMAT_4_3, /* Select 4:3 format */
|
||||
VIDEO_FORMAT_16_9, /* Select 16:9 format. */
|
@ -1,35 +0,0 @@
|
||||
diff -Naur linux-2.6.29-rc3.orig/sound/usb/usbmixer_maps.c linux-2.6.29-rc3/sound/usb/usbmixer_maps.c
|
||||
--- linux-2.6.29-rc3.orig/sound/usb/usbmixer_maps.c 2009-01-31 18:44:42.000000000 +0100
|
||||
+++ linux-2.6.29-rc3/sound/usb/usbmixer_maps.c 2009-01-31 18:53:29.000000000 +0100
|
||||
@@ -284,6 +284,11 @@
|
||||
.id = USB_ID(0x041e, 0x3040),
|
||||
.map = live24ext_map,
|
||||
},
|
||||
+ {
|
||||
+ .id = USB_ID(0x041e, 0x3048),
|
||||
+ .map = audigy2nx_map,
|
||||
+ .selector_map = audigy2nx_selectors,
|
||||
+ },
|
||||
{
|
||||
/* Hercules DJ Console (Windows Edition) */
|
||||
.id = USB_ID(0x06f8, 0xb000),
|
||||
diff -Naur linux-2.6.29-rc3.orig/sound/usb/usbquirks.h linux-2.6.29-rc3/sound/usb/usbquirks.h
|
||||
--- linux-2.6.29-rc3.orig/sound/usb/usbquirks.h 2009-01-31 18:44:42.000000000 +0100
|
||||
+++ linux-2.6.29-rc3/sound/usb/usbquirks.h 2009-01-31 18:54:49.000000000 +0100
|
||||
@@ -39,6 +39,16 @@
|
||||
.idProduct = prod, \
|
||||
.bInterfaceClass = USB_CLASS_VENDOR_SPEC
|
||||
|
||||
+/* Creative/Toshiba Multimedia Center SB-0500 */
|
||||
+{
|
||||
+ USB_DEVICE(0x041e, 0x3048),
|
||||
+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
|
||||
+ .vendor_name = "Toshiba",
|
||||
+ .product_name = "SB-0500",
|
||||
+ .ifnum = QUIRK_NO_INTERFACE
|
||||
+ }
|
||||
+},
|
||||
+
|
||||
/* Creative/E-Mu devices */
|
||||
{
|
||||
USB_DEVICE(0x041e, 0x3010),
|
@ -1,75 +0,0 @@
|
||||
diff -ur linux/drivers/media/dvb/ttpci/av7110_ca.c linux/drivers/media/dvb/ttpci/av7110_ca.c
|
||||
--- linux/drivers/media/dvb/ttpci/av7110_ca.c 2004-01-09 14:44:57.000000000 +0100
|
||||
+++ linux/drivers/media/dvb/ttpci/av7110_ca.c 2006-05-09 19:49:42.000000000 +0200
|
||||
@@ -263,10 +266,31 @@
|
||||
}
|
||||
|
||||
case CA_GET_MSG:
|
||||
- break;
|
||||
+ {
|
||||
+ ca_pid_t *arg = (ca_pid_t*) parg;
|
||||
+ u16 buf[4], res[2];
|
||||
+ buf[0]=0x0745;
|
||||
+ buf[1]=2;
|
||||
+ buf[2]=arg->pid >> 16;
|
||||
+ buf[3]=arg->pid & 0xFFFF;
|
||||
+ av7110_fw_request(av7110,buf,sizeof(buf),res,2);
|
||||
+ arg->index=(res[0]<<16) + res[1];
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
case CA_SEND_MSG:
|
||||
- break;
|
||||
+ {
|
||||
+ ca_pid_t *arg = (ca_pid_t*) parg;
|
||||
+ u16 buf[6], res[2];
|
||||
+ buf[0]=0x0746;
|
||||
+ buf[1]=4;
|
||||
+ buf[2]=arg->pid >> 16;
|
||||
+ buf[3]=arg->pid & 0xFFFF;
|
||||
+ buf[4]=arg->index >> 16;
|
||||
+ buf[5]=arg->index & 0xFFFF;
|
||||
+ av7110_fw_request(av7110,buf,sizeof(buf),res,2);
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
case CA_GET_DESCR_INFO:
|
||||
{
|
||||
@@ -295,6 +319,37 @@
|
||||
break;
|
||||
}
|
||||
|
||||
+ case CA_SET_PID:
|
||||
+ {
|
||||
+ int handle;
|
||||
+ ca_pid_t *pid = (ca_pid_t*) parg;
|
||||
+
|
||||
+ if (pid->pid >= 0x1fff)
|
||||
+ return -EINVAL;
|
||||
+ if (pid->index < 0 || pid->index >= 16)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (mutex_lock_interruptible (&av7110->demux.mutex))
|
||||
+ return -ERESTARTSYS;
|
||||
+
|
||||
+ for(handle=0; handle<32; handle++) {
|
||||
+ struct dvb_demux_filter *dvbdmxfilter=av7110->handle2filter[handle];
|
||||
+ if(dvbdmxfilter) {
|
||||
+ struct dvb_demux_feed *feed=dvbdmxfilter->feed;
|
||||
+ if(feed && feed->state==DMX_STATE_GO && feed->pid==pid->pid) {
|
||||
+ /* we map the new cmd to CacheError as it's not
|
||||
+ implemented anyways, i.e. free. */
|
||||
+ av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, CacheError, 1,
|
||||
+ (handle<<8)|pid->index); /* hw handle / cw index*/
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ mutex_unlock(&av7110->demux.mutex);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
From 76ec0e2e6d6edf81abc0331d5e7873ef7b2f6019 Mon Sep 17 00:00:00 2001
|
||||
From: Kyle McMartin <kyle@phobos.i.jkkm.org>
|
||||
Date: Wed, 8 Jul 2009 13:06:01 -0400
|
||||
Subject: [PATCH 6/6] fedora: linux-2.6-debug-always-inline-kzalloc.patch
|
||||
|
||||
---
|
||||
include/linux/slab.h | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/include/linux/slab.h b/include/linux/slab.h
|
||||
index 2da8372..d4ef74f 100644
|
||||
--- a/include/linux/slab.h
|
||||
+++ b/include/linux/slab.h
|
||||
@@ -310,7 +310,7 @@ static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
|
||||
* @size: how many bytes of memory are required.
|
||||
* @flags: the type of memory to allocate (see kmalloc).
|
||||
*/
|
||||
-static inline void *kzalloc(size_t size, gfp_t flags)
|
||||
+static __always_inline void *kzalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
return kmalloc(size, flags | __GFP_ZERO);
|
||||
}
|
||||
--
|
||||
1.6.2.5
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,429 +0,0 @@
|
||||
Rework the lirc_streamzap buffers a bit, see if we can't get it behaving
|
||||
better when the receiver is pulled... (rhbz#508952)
|
||||
|
||||
---
|
||||
drivers/input/lirc/lirc_streamzap.c | 207 +++++++++++++++++++----------------
|
||||
1 files changed, 112 insertions(+), 95 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/lirc/lirc_streamzap.c b/drivers/input/lirc/lirc_streamzap.c
|
||||
index d1ce354..a5f3140 100644
|
||||
--- a/drivers/input/lirc/lirc_streamzap.c
|
||||
+++ b/drivers/input/lirc/lirc_streamzap.c
|
||||
@@ -73,7 +73,7 @@ MODULE_DEVICE_TABLE(usb, streamzap_table);
|
||||
#define STREAMZAP_RESOLUTION 256
|
||||
|
||||
/* number of samples buffered */
|
||||
-#define STREAMZAP_BUFFER_SIZE 128
|
||||
+#define STREAMZAP_BUF_LEN 128
|
||||
|
||||
enum StreamzapDecoderState {
|
||||
PulseSpace,
|
||||
@@ -121,9 +121,8 @@ struct usb_streamzap {
|
||||
struct urb *urb_in;
|
||||
|
||||
/* lirc */
|
||||
- struct lirc_driver driver;
|
||||
- struct lirc_buffer delay_buf;
|
||||
- struct lirc_buffer lirc_buf;
|
||||
+ struct lirc_driver *driver;
|
||||
+ struct lirc_buffer *delay_buf;
|
||||
|
||||
/* timer used to support delay buffering */
|
||||
struct timer_list delay_timer;
|
||||
@@ -199,18 +198,18 @@ static void delay_timeout(unsigned long arg)
|
||||
|
||||
spin_lock_irqsave(&sz->timer_lock, flags);
|
||||
|
||||
- if (!lirc_buffer_empty(&sz->delay_buf) &&
|
||||
- !lirc_buffer_full(&sz->lirc_buf)) {
|
||||
- lirc_buffer_read(&sz->delay_buf, (unsigned char *) &data);
|
||||
- lirc_buffer_write(&sz->lirc_buf, (unsigned char *) &data);
|
||||
+ if (!lirc_buffer_empty(sz->delay_buf) &&
|
||||
+ !lirc_buffer_full(sz->driver->rbuf)) {
|
||||
+ lirc_buffer_read(sz->delay_buf, (unsigned char *) &data);
|
||||
+ lirc_buffer_write(sz->driver->rbuf, (unsigned char *) &data);
|
||||
}
|
||||
- if (!lirc_buffer_empty(&sz->delay_buf)) {
|
||||
- while (lirc_buffer_available(&sz->delay_buf) <
|
||||
- STREAMZAP_BUFFER_SIZE/2 &&
|
||||
- !lirc_buffer_full(&sz->lirc_buf)) {
|
||||
- lirc_buffer_read(&sz->delay_buf,
|
||||
+ if (!lirc_buffer_empty(sz->delay_buf)) {
|
||||
+ while (lirc_buffer_available(sz->delay_buf) <
|
||||
+ STREAMZAP_BUF_LEN / 2 &&
|
||||
+ !lirc_buffer_full(sz->driver->rbuf)) {
|
||||
+ lirc_buffer_read(sz->delay_buf,
|
||||
(unsigned char *) &data);
|
||||
- lirc_buffer_write(&sz->lirc_buf,
|
||||
+ lirc_buffer_write(sz->driver->rbuf,
|
||||
(unsigned char *) &data);
|
||||
}
|
||||
if (sz->timer_running) {
|
||||
@@ -221,8 +220,8 @@ static void delay_timeout(unsigned long arg)
|
||||
sz->timer_running = 0;
|
||||
}
|
||||
|
||||
- if (!lirc_buffer_empty(&sz->lirc_buf))
|
||||
- wake_up(&sz->lirc_buf.wait_poll);
|
||||
+ if (!lirc_buffer_empty(sz->driver->rbuf))
|
||||
+ wake_up(&sz->driver->rbuf->wait_poll);
|
||||
|
||||
spin_unlock_irqrestore(&sz->timer_lock, flags);
|
||||
}
|
||||
@@ -232,18 +231,18 @@ static void flush_delay_buffer(struct usb_streamzap *sz)
|
||||
int data;
|
||||
int empty = 1;
|
||||
|
||||
- while (!lirc_buffer_empty(&sz->delay_buf)) {
|
||||
+ while (!lirc_buffer_empty(sz->delay_buf)) {
|
||||
empty = 0;
|
||||
- lirc_buffer_read(&sz->delay_buf, (unsigned char *) &data);
|
||||
- if (!lirc_buffer_full(&sz->lirc_buf)) {
|
||||
- lirc_buffer_write(&sz->lirc_buf,
|
||||
+ lirc_buffer_read(sz->delay_buf, (unsigned char *) &data);
|
||||
+ if (!lirc_buffer_full(sz->driver->rbuf)) {
|
||||
+ lirc_buffer_write(sz->driver->rbuf,
|
||||
(unsigned char *) &data);
|
||||
} else {
|
||||
- dprintk("buffer overflow", sz->driver.minor);
|
||||
+ dprintk("buffer overflow", sz->driver->minor);
|
||||
}
|
||||
}
|
||||
if (!empty)
|
||||
- wake_up(&sz->lirc_buf.wait_poll);
|
||||
+ wake_up(&sz->driver->rbuf->wait_poll);
|
||||
}
|
||||
|
||||
static void push(struct usb_streamzap *sz, unsigned char *data)
|
||||
@@ -251,20 +250,20 @@ static void push(struct usb_streamzap *sz, unsigned char *data)
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&sz->timer_lock, flags);
|
||||
- if (lirc_buffer_full(&sz->delay_buf)) {
|
||||
+ if (lirc_buffer_full(sz->delay_buf)) {
|
||||
int read_data;
|
||||
|
||||
- lirc_buffer_read(&sz->delay_buf,
|
||||
+ lirc_buffer_read(sz->delay_buf,
|
||||
(unsigned char *) &read_data);
|
||||
- if (!lirc_buffer_full(&sz->lirc_buf)) {
|
||||
- lirc_buffer_write(&sz->lirc_buf,
|
||||
+ if (!lirc_buffer_full(sz->driver->rbuf)) {
|
||||
+ lirc_buffer_write(sz->driver->rbuf,
|
||||
(unsigned char *) &read_data);
|
||||
} else {
|
||||
- dprintk("buffer overflow", sz->driver.minor);
|
||||
+ dprintk("buffer overflow", sz->driver->minor);
|
||||
}
|
||||
}
|
||||
|
||||
- lirc_buffer_write(&sz->delay_buf, data);
|
||||
+ lirc_buffer_write(sz->delay_buf, data);
|
||||
|
||||
if (!sz->timer_running) {
|
||||
sz->delay_timer.expires = jiffies + HZ/10;
|
||||
@@ -296,7 +295,7 @@ static void push_full_pulse(struct usb_streamzap *sz,
|
||||
sz->signal_last.tv_usec);
|
||||
tmp -= sz->sum;
|
||||
}
|
||||
- dprintk("ls %u", sz->driver.minor, tmp);
|
||||
+ dprintk("ls %u", sz->driver->minor, tmp);
|
||||
push(sz, (char *)&tmp);
|
||||
|
||||
sz->idle = 0;
|
||||
@@ -308,7 +307,7 @@ static void push_full_pulse(struct usb_streamzap *sz,
|
||||
sz->sum += pulse;
|
||||
pulse |= PULSE_BIT;
|
||||
|
||||
- dprintk("p %u", sz->driver.minor, pulse & PULSE_MASK);
|
||||
+ dprintk("p %u", sz->driver->minor, pulse & PULSE_MASK);
|
||||
push(sz, (char *)&pulse);
|
||||
}
|
||||
|
||||
@@ -326,7 +325,7 @@ static void push_full_space(struct usb_streamzap *sz,
|
||||
space = ((int) value)*STREAMZAP_RESOLUTION;
|
||||
space += STREAMZAP_RESOLUTION/2;
|
||||
sz->sum += space;
|
||||
- dprintk("s %u", sz->driver.minor, space);
|
||||
+ dprintk("s %u", sz->driver->minor, space);
|
||||
push(sz, (char *)&space);
|
||||
}
|
||||
|
||||
@@ -368,10 +367,10 @@ static void usb_streamzap_irq(struct urb *urb)
|
||||
break;
|
||||
}
|
||||
|
||||
- dprintk("received %d", sz->driver.minor, urb->actual_length);
|
||||
+ dprintk("received %d", sz->driver->minor, urb->actual_length);
|
||||
if (!sz->flush) {
|
||||
for (i = 0; i < urb->actual_length; i++) {
|
||||
- dprintk("%d: %x", sz->driver.minor,
|
||||
+ dprintk("%d: %x", sz->driver->minor,
|
||||
i, (unsigned char) sz->buf_in[i]);
|
||||
switch (sz->decoder_state) {
|
||||
case PulseSpace:
|
||||
@@ -443,14 +442,18 @@ static int streamzap_probe(struct usb_interface *interface,
|
||||
{
|
||||
struct usb_device *udev = interface_to_usbdev(interface);
|
||||
struct usb_host_interface *iface_host;
|
||||
- int retval = -ENOMEM;
|
||||
- struct usb_streamzap *sz = NULL;
|
||||
+ struct usb_streamzap *sz;
|
||||
+ struct lirc_driver *driver;
|
||||
+ struct lirc_buffer *lirc_buf;
|
||||
+ struct lirc_buffer *delay_buf;
|
||||
char buf[63], name[128] = "";
|
||||
+ int retval = -ENOMEM;
|
||||
+ int minor = 0;
|
||||
|
||||
/* Allocate space for device driver specific data */
|
||||
sz = kzalloc(sizeof(struct usb_streamzap), GFP_KERNEL);
|
||||
if (sz == NULL)
|
||||
- goto error;
|
||||
+ return -ENOMEM;
|
||||
|
||||
sz->udev = udev;
|
||||
sz->interface = interface;
|
||||
@@ -462,7 +465,7 @@ static int streamzap_probe(struct usb_interface *interface,
|
||||
err("%s: Unexpected desc.bNumEndpoints (%d)", __func__,
|
||||
iface_host->desc.bNumEndpoints);
|
||||
retval = -ENODEV;
|
||||
- goto error;
|
||||
+ goto free_sz;
|
||||
}
|
||||
|
||||
sz->endpoint = &(iface_host->endpoint[0].desc);
|
||||
@@ -471,7 +474,7 @@ static int streamzap_probe(struct usb_interface *interface,
|
||||
err("%s: endpoint doesn't match input device 02%02x",
|
||||
__func__, sz->endpoint->bEndpointAddress);
|
||||
retval = -ENODEV;
|
||||
- goto error;
|
||||
+ goto free_sz;
|
||||
}
|
||||
|
||||
if ((sz->endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
|
||||
@@ -479,13 +482,13 @@ static int streamzap_probe(struct usb_interface *interface,
|
||||
err("%s: endpoint attributes don't match xfer 02%02x",
|
||||
__func__, sz->endpoint->bmAttributes);
|
||||
retval = -ENODEV;
|
||||
- goto error;
|
||||
+ goto free_sz;
|
||||
}
|
||||
|
||||
if (sz->endpoint->wMaxPacketSize == 0) {
|
||||
err("%s: endpoint message size==0? ", __func__);
|
||||
retval = -ENODEV;
|
||||
- goto error;
|
||||
+ goto free_sz;
|
||||
}
|
||||
|
||||
/* Allocate the USB buffer and IRQ URB */
|
||||
@@ -494,36 +497,43 @@ static int streamzap_probe(struct usb_interface *interface,
|
||||
sz->buf_in = usb_buffer_alloc(sz->udev, sz->buf_in_len,
|
||||
GFP_ATOMIC, &sz->dma_in);
|
||||
if (sz->buf_in == NULL)
|
||||
- goto error;
|
||||
+ goto free_sz;
|
||||
|
||||
sz->urb_in = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (sz->urb_in == NULL)
|
||||
- goto error;
|
||||
+ goto free_sz;
|
||||
|
||||
/* Connect this device to the LIRC sub-system */
|
||||
-
|
||||
- if (lirc_buffer_init(&sz->lirc_buf, sizeof(int),
|
||||
- STREAMZAP_BUFFER_SIZE))
|
||||
- goto error;
|
||||
-
|
||||
- if (lirc_buffer_init(&sz->delay_buf, sizeof(int),
|
||||
- STREAMZAP_BUFFER_SIZE)) {
|
||||
- lirc_buffer_free(&sz->lirc_buf);
|
||||
- goto error;
|
||||
- }
|
||||
-
|
||||
- strcpy(sz->driver.name, DRIVER_NAME);
|
||||
- sz->driver.minor = -1;
|
||||
- sz->driver.sample_rate = 0;
|
||||
- sz->driver.code_length = sizeof(int) * 8;
|
||||
- sz->driver.features = LIRC_CAN_REC_MODE2 | LIRC_CAN_GET_REC_RESOLUTION;
|
||||
- sz->driver.data = sz;
|
||||
- sz->driver.rbuf = &sz->lirc_buf;
|
||||
- sz->driver.set_use_inc = &streamzap_use_inc;
|
||||
- sz->driver.set_use_dec = &streamzap_use_dec;
|
||||
- sz->driver.fops = &streamzap_fops;
|
||||
- sz->driver.dev = &interface->dev;
|
||||
- sz->driver.owner = THIS_MODULE;
|
||||
+ driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
|
||||
+ if (!driver)
|
||||
+ goto free_sz;
|
||||
+
|
||||
+ lirc_buf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
|
||||
+ if (!lirc_buf)
|
||||
+ goto free_driver;
|
||||
+ if (lirc_buffer_init(lirc_buf, sizeof(int), STREAMZAP_BUF_LEN))
|
||||
+ goto kfree_lirc_buf;
|
||||
+
|
||||
+ delay_buf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
|
||||
+ if (!delay_buf)
|
||||
+ goto free_lirc_buf;
|
||||
+ if (lirc_buffer_init(delay_buf, sizeof(int), STREAMZAP_BUF_LEN))
|
||||
+ goto kfree_delay_buf;
|
||||
+
|
||||
+ sz->driver = driver;
|
||||
+ strcpy(sz->driver->name, DRIVER_NAME);
|
||||
+ sz->driver->minor = -1;
|
||||
+ sz->driver->sample_rate = 0;
|
||||
+ sz->driver->code_length = sizeof(int) * 8;
|
||||
+ sz->driver->features = LIRC_CAN_REC_MODE2 | LIRC_CAN_GET_REC_RESOLUTION;
|
||||
+ sz->driver->data = sz;
|
||||
+ sz->driver->rbuf = lirc_buf;
|
||||
+ sz->delay_buf = delay_buf;
|
||||
+ sz->driver->set_use_inc = &streamzap_use_inc;
|
||||
+ sz->driver->set_use_dec = &streamzap_use_dec;
|
||||
+ sz->driver->fops = &streamzap_fops;
|
||||
+ sz->driver->dev = &interface->dev;
|
||||
+ sz->driver->owner = THIS_MODULE;
|
||||
|
||||
sz->idle = 1;
|
||||
sz->decoder_state = PulseSpace;
|
||||
@@ -556,28 +566,32 @@ static int streamzap_probe(struct usb_interface *interface,
|
||||
snprintf(name + strlen(name), sizeof(name) - strlen(name),
|
||||
" %s", buf);
|
||||
|
||||
- printk(KERN_INFO DRIVER_NAME "[%d]: %s on usb%d:%d attached\n",
|
||||
- sz->driver.minor, name,
|
||||
- udev->bus->busnum, sz->udev->devnum);
|
||||
+ minor = lirc_register_driver(driver);
|
||||
|
||||
- usb_set_intfdata(interface, sz);
|
||||
+ if (minor < 0)
|
||||
+ goto free_delay_buf;
|
||||
|
||||
- if (lirc_register_driver(&sz->driver) < 0) {
|
||||
- lirc_buffer_free(&sz->delay_buf);
|
||||
- lirc_buffer_free(&sz->lirc_buf);
|
||||
- goto error;
|
||||
- }
|
||||
+ sz->driver->minor = minor;
|
||||
|
||||
- return 0;
|
||||
+ usb_set_intfdata(interface, sz);
|
||||
|
||||
-error:
|
||||
+ printk(KERN_INFO DRIVER_NAME "[%d]: %s on usb%d:%d attached\n",
|
||||
+ sz->driver->minor, name,
|
||||
+ udev->bus->busnum, sz->udev->devnum);
|
||||
|
||||
- /*
|
||||
- * Premise is that a 'goto error' can be invoked from inside the
|
||||
- * probe function and all necessary cleanup actions will be taken
|
||||
- * including freeing any necessary memory blocks
|
||||
- */
|
||||
+ return 0;
|
||||
|
||||
+free_delay_buf:
|
||||
+ lirc_buffer_free(sz->delay_buf);
|
||||
+kfree_delay_buf:
|
||||
+ kfree(delay_buf);
|
||||
+free_lirc_buf:
|
||||
+ lirc_buffer_free(sz->driver->rbuf);
|
||||
+kfree_lirc_buf:
|
||||
+ kfree(lirc_buf);
|
||||
+free_driver:
|
||||
+ kfree(driver);
|
||||
+free_sz:
|
||||
if (retval == -ENOMEM)
|
||||
err("Out of memory");
|
||||
|
||||
@@ -598,10 +612,10 @@ static int streamzap_use_inc(void *data)
|
||||
dprintk("%s called with no context", -1, __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
- dprintk("set use inc", sz->driver.minor);
|
||||
+ dprintk("set use inc", sz->driver->minor);
|
||||
|
||||
- lirc_buffer_clear(&sz->lirc_buf);
|
||||
- lirc_buffer_clear(&sz->delay_buf);
|
||||
+ lirc_buffer_clear(sz->driver->rbuf);
|
||||
+ lirc_buffer_clear(sz->delay_buf);
|
||||
|
||||
sz->flush_timer.expires = jiffies + HZ;
|
||||
sz->flush = 1;
|
||||
@@ -610,7 +624,7 @@ static int streamzap_use_inc(void *data)
|
||||
sz->urb_in->dev = sz->udev;
|
||||
if (usb_submit_urb(sz->urb_in, GFP_ATOMIC)) {
|
||||
dprintk("open result = -EIO error submitting urb",
|
||||
- sz->driver.minor);
|
||||
+ sz->driver->minor);
|
||||
return -EIO;
|
||||
}
|
||||
sz->in_use++;
|
||||
@@ -626,7 +640,7 @@ static void streamzap_use_dec(void *data)
|
||||
dprintk("%s called with no context", -1, __func__);
|
||||
return;
|
||||
}
|
||||
- dprintk("set use dec", sz->driver.minor);
|
||||
+ dprintk("set use dec", sz->driver->minor);
|
||||
|
||||
if (sz->flush) {
|
||||
sz->flush = 0;
|
||||
@@ -677,13 +691,13 @@ static void streamzap_disconnect(struct usb_interface *interface)
|
||||
|
||||
/* unregister from the LIRC sub-system */
|
||||
|
||||
- errnum = lirc_unregister_driver(sz->driver.minor);
|
||||
+ errnum = lirc_unregister_driver(sz->driver->minor);
|
||||
if (errnum != 0)
|
||||
dprintk("error in lirc_unregister: (returned %d)",
|
||||
- sz->driver.minor, errnum);
|
||||
+ sz->driver->minor, errnum);
|
||||
|
||||
- lirc_buffer_free(&sz->delay_buf);
|
||||
- lirc_buffer_free(&sz->lirc_buf);
|
||||
+ lirc_buffer_free(sz->delay_buf);
|
||||
+ lirc_buffer_free(sz->driver->rbuf);
|
||||
|
||||
/* unregister from the USB sub-system */
|
||||
|
||||
@@ -691,7 +705,10 @@ static void streamzap_disconnect(struct usb_interface *interface)
|
||||
|
||||
usb_buffer_free(sz->udev, sz->buf_in_len, sz->buf_in, sz->dma_in);
|
||||
|
||||
- minor = sz->driver.minor;
|
||||
+ minor = sz->driver->minor;
|
||||
+ kfree(sz->driver->rbuf);
|
||||
+ kfree(sz->driver);
|
||||
+ kfree(sz->delay_buf);
|
||||
kfree(sz);
|
||||
|
||||
printk(KERN_INFO DRIVER_NAME "[%d]: disconnected\n", minor);
|
||||
@@ -701,7 +718,7 @@ static int streamzap_suspend(struct usb_interface *intf, pm_message_t message)
|
||||
{
|
||||
struct usb_streamzap *sz = usb_get_intfdata(intf);
|
||||
|
||||
- printk(KERN_INFO DRIVER_NAME "[%d]: suspend\n", sz->driver.minor);
|
||||
+ printk(KERN_INFO DRIVER_NAME "[%d]: suspend\n", sz->driver->minor);
|
||||
if (sz->in_use) {
|
||||
if (sz->flush) {
|
||||
sz->flush = 0;
|
||||
@@ -719,8 +736,8 @@ static int streamzap_resume(struct usb_interface *intf)
|
||||
{
|
||||
struct usb_streamzap *sz = usb_get_intfdata(intf);
|
||||
|
||||
- lirc_buffer_clear(&sz->lirc_buf);
|
||||
- lirc_buffer_clear(&sz->delay_buf);
|
||||
+ lirc_buffer_clear(sz->driver->rbuf);
|
||||
+ lirc_buffer_clear(sz->delay_buf);
|
||||
|
||||
if (sz->in_use) {
|
||||
sz->flush_timer.expires = jiffies + HZ;
|
||||
@@ -730,7 +747,7 @@ static int streamzap_resume(struct usb_interface *intf)
|
||||
sz->urb_in->dev = sz->udev;
|
||||
if (usb_submit_urb(sz->urb_in, GFP_ATOMIC)) {
|
||||
dprintk("open result = -EIO error submitting urb",
|
||||
- sz->driver.minor);
|
||||
+ sz->driver->minor);
|
||||
return -EIO;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user