git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
arch
/
mips
/
au1000
/
common
/
usbdev.c
diff --git
a/arch/mips/au1000/common/usbdev.c
b/arch/mips/au1000/common/usbdev.c
index
21e2a91
..
2cab762
100644
(file)
--- a/
arch/mips/au1000/common/usbdev.c
+++ b/
arch/mips/au1000/common/usbdev.c
@@
-61,8
+61,6
@@
#define vdbg(fmt, arg...) do {} while (0)
#endif
#define vdbg(fmt, arg...) do {} while (0)
#endif
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
#define ALLOC_FLAGS (in_interrupt () ? GFP_ATOMIC : GFP_KERNEL)
#define EP_FIFO_DEPTH 8
#define ALLOC_FLAGS (in_interrupt () ? GFP_ATOMIC : GFP_KERNEL)
#define EP_FIFO_DEPTH 8
@@
-211,9
+209,8
@@
dump_setup(struct usb_ctrlrequest* s)
static inline usbdev_pkt_t *
alloc_packet(endpoint_t * ep, int data_size, void* data)
{
static inline usbdev_pkt_t *
alloc_packet(endpoint_t * ep, int data_size, void* data)
{
- usbdev_pkt_t* pkt =
- (usbdev_pkt_t *)kmalloc(sizeof(usbdev_pkt_t) + data_size,
- ALLOC_FLAGS);
+ usbdev_pkt_t* pkt = kmalloc(sizeof(usbdev_pkt_t) + data_size,
+ ALLOC_FLAGS);
if (!pkt)
return NULL;
pkt->ep_addr = ep->address;
if (!pkt)
return NULL;
pkt->ep_addr = ep->address;
@@
-351,7
+348,7
@@
endpoint_stall(endpoint_t * ep)
{
u32 cs;
{
u32 cs;
- warn(__FUNCTION__);
+ warn(
"%s",
__FUNCTION__);
cs = au_readl(ep->reg->ctrl_stat) | USBDEV_CS_STALL;
au_writel(cs, ep->reg->ctrl_stat);
cs = au_readl(ep->reg->ctrl_stat) | USBDEV_CS_STALL;
au_writel(cs, ep->reg->ctrl_stat);
@@
-363,7
+360,7
@@
endpoint_unstall(endpoint_t * ep)
{
u32 cs;
{
u32 cs;
- warn(__FUNCTION__);
+ warn(
"%s",
__FUNCTION__);
cs = au_readl(ep->reg->ctrl_stat) & ~USBDEV_CS_STALL;
au_writel(cs, ep->reg->ctrl_stat);
cs = au_readl(ep->reg->ctrl_stat) & ~USBDEV_CS_STALL;
au_writel(cs, ep->reg->ctrl_stat);
@@
-769,7
+766,7
@@
do_get_descriptor(struct usb_dev* dev, struct usb_ctrlrequest* setup)
dev->conf_desc),
0);
} else {
dev->conf_desc),
0);
} else {
- int len =
dev->conf_desc->wTotalLength
;
+ int len =
le16_to_cpu(dev->conf_desc->wTotalLength)
;
dbg("sending whole config desc,"
" size=%d, our size=%d", desc_len, len);
desc_len = desc_len > len ? len : desc_len;
dbg("sending whole config desc,"
" size=%d, our size=%d", desc_len, len);
desc_len = desc_len > len ? len : desc_len;
@@
-1008,11
+1005,11
@@
process_ep0_receive (struct usb_dev* dev)
#endif
dev->ep0_stage = SETUP_STAGE;
break;
#endif
dev->ep0_stage = SETUP_STAGE;
break;
-
}
+ }
spin_unlock(&ep0->lock);
spin_unlock(&ep0->lock);
-
// we're done processing the packet, free it
-
kfree(pkt);
+ // we're done processing the packet, free it
+ kfree(pkt);
}
}
@@
-1075,8
+1072,7
@@
dma_done_ep0_intr(int irq, void *dev_id, struct pt_regs *regs)
clear_dma_done1(ep0->indma);
pkt = send_packet_complete(ep0);
clear_dma_done1(ep0->indma);
pkt = send_packet_complete(ep0);
- if (pkt)
- kfree(pkt);
+ kfree(pkt);
}
/*
}
/*
@@
-1305,8
+1301,7
@@
usbdev_exit(void)
endpoint_flush(ep);
}
endpoint_flush(ep);
}
- if (usbdev.full_conf_desc)
- kfree(usbdev.full_conf_desc);
+ kfree(usbdev.full_conf_desc);
}
int
}
int
@@
-1401,7
+1396,7
@@
usbdev_init(struct usb_device_descriptor* dev_desc,
epd->bEndpointAddress |= (u8)ep->address;
ep->direction = epd->bEndpointAddress & 0x80;
ep->type = epd->bmAttributes & 0x03;
epd->bEndpointAddress |= (u8)ep->address;
ep->direction = epd->bEndpointAddress & 0x80;
ep->type = epd->bmAttributes & 0x03;
- ep->max_pkt_size =
epd->wMaxPacketSize
;
+ ep->max_pkt_size =
le16_to_cpu(epd->wMaxPacketSize)
;
spin_lock_init(&ep->lock);
ep->desc = epd;
ep->reg = &ep_reg[ep->address];
spin_lock_init(&ep->lock);
ep->desc = epd;
ep->reg = &ep_reg[ep->address];
@@
-1410,7
+1405,7
@@
usbdev_init(struct usb_device_descriptor* dev_desc,
/*
* initialize the full config descriptor
*/
/*
* initialize the full config descriptor
*/
- usbdev.full_conf_desc = fcd = kmalloc(
config_desc->wTotalLength
,
+ usbdev.full_conf_desc = fcd = kmalloc(
le16_to_cpu(config_desc->wTotalLength)
,
ALLOC_FLAGS);
if (!fcd) {
err("failed to alloc full config descriptor");
ALLOC_FLAGS);
if (!fcd) {
err("failed to alloc full config descriptor");