[#4587] musb driver should use static inline functions for stubs
Submitted By: Mike Frysinger
Open Date
2008-11-01 02:51:51 Close Date
2008-11-13 03:15:58
Priority:
Medium Assignee:
Bryan Wu
Status:
Closed Fixed In Release:
N/A
Found In Release:
N/A Release:
Category:
N/A Board:
N/A
Processor:
N/A Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Fixed
Uboot version or rev.:
Toolchain version or rev.:
App binary format:
N/A
Summary: musb driver should use static inline functions for stubs
Details:
the musb header uses define's to stub out functions:
#define clk_get(dev, id) NULL
#define clk_put(clock) do {} while (0)
#define clk_enable(clock) do {} while (0)
#define clk_disable(clock) do {} while (0)
#define musb_write_txfifosz(mbase, c_size) do {} while (0)
#define musb_write_txfifoadd(mbase, c_off) do {} while (0)
#define musb_write_rxfifosz(mbase, c_size) do {} while (0)
#define musb_write_rxfifoadd(mbase, c_off) do {} while (0)
#define musb_read_configdata(mbase) 0
#define musb_read_hwvers(mbase) 0
#define musb_read_target_reg_base(i, mbase) 0
#define musb_write_rxfunaddr(ep_target_regs, qh_addr_reg) do {} while (0)
#define musb_write_rxhubaddr(ep_target_regs, qh_h_addr_reg) do {} while (0)
#define musb_write_rxhubport(ep_target_regs, qh_h_port_reg) do {} while (0)
#define musb_write_txfunaddr(mbase, epnum, qh_addr_reg) do {} while (0)
#define musb_write_txhubaddr(mbase, epnum, qh_h_addr_reg) do {} while (0)
#define musb_write_txhubport(mbase, epnum, qh_h_port_reg) do {} while (0)
these should be static inline's so that side effects in function usage dont get messed up. for example, if someone used a ++ or -- or = operator in the argument list.
Follow-ups
--- Bryan Wu 2008-11-07 05:38:46
fixed all musb stubs here, but remain clk_xxx stubs because it needs to define
struck clk. IMO, we might add clk support in the future.
-Bryan
--- Mike Frysinger 2008-11-10 11:27:25
how about this now ?
drivers/usb/musb/musb_core.c:1433: warning: assignment makes pointer from
integer without a cast
hw_ep->target_regs = musb_read_target_reg_base(i, mbase);
static inline u16 musb_read_target_reg_base(u8 i, void __iomem *mbase);
this is a common bug, but a bug still ? mbase is a 32/64 bit pointer, but we
return a u16 to assign to a pointer ? seems odd
--- Bryan Wu 2008-11-10 23:23:28
Thanks, Mike.
I fixed this and will send it to upstream.
-Bryan
--- Bryan Wu 2008-11-13 03:15:58
fixed. so close this tracker.
-Bryan
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found