summaryrefslogtreecommitdiff
path: root/target/linux/adm5120
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-02-27 16:26:49 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-02-27 16:26:49 +0000
commite96a82e37ef0d6fcc9465a58435157c9489b4040 (patch)
treed480cccb7cc1fad51dc7e293af25d839de0db19f /target/linux/adm5120
parent9be4598569354995d6dfe5359d653bb24ffbb832 (diff)
downloadmtk-20170518-e96a82e37ef0d6fcc9465a58435157c9489b4040.zip
mtk-20170518-e96a82e37ef0d6fcc9465a58435157c9489b4040.tar.gz
mtk-20170518-e96a82e37ef0d6fcc9465a58435157c9489b4040.tar.bz2
adm5120: fix build error in the USB driver on 2.6.32
SVN-Revision: 19882
Diffstat (limited to 'target/linux/adm5120')
-rw-r--r--target/linux/adm5120/patches-2.6.32/901-adm5120-usb-fix-compiler-warning.patch11
-rw-r--r--target/linux/adm5120/patches-2.6.32/902-adm5120-usb-remove-dev-power-power_state.patch11
-rw-r--r--target/linux/adm5120/patches-2.6.32/903-adm5120-usb-use-the-admhcd-structure-directly-in-debugfs-files.patch116
3 files changed, 138 insertions, 0 deletions
diff --git a/target/linux/adm5120/patches-2.6.32/901-adm5120-usb-fix-compiler-warning.patch b/target/linux/adm5120/patches-2.6.32/901-adm5120-usb-fix-compiler-warning.patch
new file mode 100644
index 0000000..93149df
--- /dev/null
+++ b/target/linux/adm5120/patches-2.6.32/901-adm5120-usb-fix-compiler-warning.patch
@@ -0,0 +1,11 @@
+--- a/drivers/usb/host/adm5120-dbg.c
++++ b/drivers/usb/host/adm5120-dbg.c
+@@ -133,7 +133,7 @@ urb_print(struct admhcd *ahcd, struct ur
+
+ #define admhc_dbg_sw(ahcd, next, size, format, arg...) \
+ do { \
+- if (next) { \
++ if (next != NULL) { \
+ unsigned s_len; \
+ s_len = scnprintf(*next, *size, format, ## arg ); \
+ *size -= s_len; *next += s_len; \
diff --git a/target/linux/adm5120/patches-2.6.32/902-adm5120-usb-remove-dev-power-power_state.patch b/target/linux/adm5120/patches-2.6.32/902-adm5120-usb-remove-dev-power-power_state.patch
new file mode 100644
index 0000000..0256bc6
--- /dev/null
+++ b/target/linux/adm5120/patches-2.6.32/902-adm5120-usb-remove-dev-power-power_state.patch
@@ -0,0 +1,11 @@
+--- a/drivers/usb/host/adm5120-dbg.c
++++ b/drivers/usb/host/adm5120-dbg.c
+@@ -632,7 +632,7 @@ static ssize_t fill_registers_buffer(str
+ hcd->product_desc,
+ hcd_name);
+
+- if (bus->controller->power.power_state.event) {
++ if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+ size -= scnprintf(next, size,
+ "SUSPENDED (no register access)\n");
+ goto done;
diff --git a/target/linux/adm5120/patches-2.6.32/903-adm5120-usb-use-the-admhcd-structure-directly-in-debugfs-files.patch b/target/linux/adm5120/patches-2.6.32/903-adm5120-usb-use-the-admhcd-structure-directly-in-debugfs-files.patch
new file mode 100644
index 0000000..db6323d
--- /dev/null
+++ b/target/linux/adm5120/patches-2.6.32/903-adm5120-usb-use-the-admhcd-structure-directly-in-debugfs-files.patch
@@ -0,0 +1,116 @@
+--- a/drivers/usb/host/adm5120-dbg.c
++++ b/drivers/usb/host/adm5120-dbg.c
+@@ -419,7 +419,7 @@ static struct dentry *admhc_debug_root;
+
+ struct debug_buffer {
+ ssize_t (*fill_func)(struct debug_buffer *); /* fill method */
+- struct device *dev;
++ struct admhcd *ahcd;
+ struct mutex mutex; /* protect filling of buffer */
+ size_t count; /* number of characters filled into buffer */
+ char *page;
+@@ -494,15 +494,11 @@ show_list(struct admhcd *ahcd, char *buf
+
+ static ssize_t fill_async_buffer(struct debug_buffer *buf)
+ {
+- struct usb_bus *bus;
+- struct usb_hcd *hcd;
+ struct admhcd *ahcd;
+ size_t temp;
+ unsigned long flags;
+
+- bus = dev_get_drvdata(buf->dev);
+- hcd = bus_to_hcd(bus);
+- ahcd = hcd_to_admhcd(hcd);
++ ahcd = buf->ahcd;
+
+ spin_lock_irqsave(&ahcd->lock, flags);
+ temp = show_list(ahcd, buf->page, PAGE_SIZE, ahcd->ed_head);
+@@ -516,8 +512,6 @@ static ssize_t fill_async_buffer(struct
+
+ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
+ {
+- struct usb_bus *bus;
+- struct usb_hcd *hcd;
+ struct admhcd *ahcd;
+ struct ed **seen, *ed;
+ unsigned long flags;
+@@ -529,9 +523,7 @@ static ssize_t fill_periodic_buffer(stru
+ return 0;
+ seen_count = 0;
+
+- bus = dev_get_drvdata(buf->dev);
+- hcd = bus_to_hcd(bus);
+- ahcd = hcd_to_admhcd(hcd);
++ ahcd = buf->ahcd;
+ next = buf->page;
+ size = PAGE_SIZE;
+
+@@ -613,7 +605,6 @@ static ssize_t fill_periodic_buffer(stru
+
+ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
+ {
+- struct usb_bus *bus;
+ struct usb_hcd *hcd;
+ struct admhcd *ahcd;
+ struct admhcd_regs __iomem *regs;
+@@ -622,9 +613,8 @@ static ssize_t fill_registers_buffer(str
+ char *next;
+ u32 rdata;
+
+- bus = dev_get_drvdata(buf->dev);
+- hcd = bus_to_hcd(bus);
+- ahcd = hcd_to_admhcd(hcd);
++ ahcd = buf->ahcd;
++ hcd = admhcd_to_hcd(ahcd);
+ regs = ahcd->regs;
+ next = buf->page;
+ size = PAGE_SIZE;
+@@ -689,7 +679,7 @@ done:
+ }
+
+
+-static struct debug_buffer *alloc_buffer(struct device *dev,
++static struct debug_buffer *alloc_buffer(struct admhcd *ahcd,
+ ssize_t (*fill_func)(struct debug_buffer *))
+ {
+ struct debug_buffer *buf;
+@@ -697,7 +687,7 @@ static struct debug_buffer *alloc_buffer
+ buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
+
+ if (buf) {
+- buf->dev = dev;
++ buf->ahcd = ahcd;
+ buf->fill_func = fill_func;
+ mutex_init(&buf->mutex);
+ }
+@@ -790,26 +780,25 @@ static int debug_registers_open(struct i
+ static inline void create_debug_files(struct admhcd *ahcd)
+ {
+ struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self;
+- struct device *dev = bus->dev;
+
+ ahcd->debug_dir = debugfs_create_dir(bus->bus_name, admhc_debug_root);
+ if (!ahcd->debug_dir)
+ goto dir_error;
+
+ ahcd->debug_async = debugfs_create_file("async", S_IRUGO,
+- ahcd->debug_dir, dev,
++ ahcd->debug_dir, ahcd,
+ &debug_async_fops);
+ if (!ahcd->debug_async)
+ goto async_error;
+
+ ahcd->debug_periodic = debugfs_create_file("periodic", S_IRUGO,
+- ahcd->debug_dir, dev,
++ ahcd->debug_dir, ahcd,
+ &debug_periodic_fops);
+ if (!ahcd->debug_periodic)
+ goto periodic_error;
+
+ ahcd->debug_registers = debugfs_create_file("registers", S_IRUGO,
+- ahcd->debug_dir, dev,
++ ahcd->debug_dir, ahcd,
+ &debug_registers_fops);
+ if (!ahcd->debug_registers)
+ goto registers_error;