
Dear Heiko Schocher,
Heiko Schocher hs@denx.de writes:
port at91_udc driver from linux:
original commit Message: commit c94e289f195e0e13cf34d27f9338d28221a85751 Author: Arnd Bergmann arnd@arndb.de Date: Sat Apr 11 00:14:21 2015 +0200
usb: gadget: remove incorrect __init/__exit annotations
A recent change introduced a link error for the composite printer gadget driver:
`printer_unbind' referenced in section `.ref.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
Evidently the unbind function should not be marked __exit here, because it is called through a callback pointer that is not necessarily discarded, __composite_unbind() is indeed called from the error path of composite_bind(), which can never work for a built-in driver.
Looking at the surrounding code, I found the same problem in all other composite gadget drivers in both the bind and unbind functions, as well as the udc platform driver 'remove' functions. Those will break if anyone uses the 'unbind' sysfs attribute to detach a device from a built-in driver.
This patch removes the incorrect annotations from all the gadget drivers.
Signed-off-by: Heiko Schocher hs@denx.de
checkpatch detects a lot of errors, but as this code is copied from linux, I tend to not fix them, so later updates with linux code is easier.
Changes in v5: None Changes in v4: None Changes in v3:
- add comments from Alexandre Belloni
get rid of cpu_is_at91*, use newer linux version as base for the port to U-Boot.
Changes in v2:
- add comments from Lukasz Majewski
- seperate usb gadget driver port from linux into 2 commits
- first patch original from linux (with complete commit message)
- second adds U-Boot changes without "#ifdef __UBOOT__"
drivers/usb/gadget/at91_udc.c | 2036 +++++++++++++++++++++++++++++++++++++++++ drivers/usb/gadget/at91_udc.h | 175 ++++ 2 files changed, 2211 insertions(+) create mode 100644 drivers/usb/gadget/at91_udc.c create mode 100644 drivers/usb/gadget/at91_udc.h
applied to u-boot-atmel/master, thanks!
Best regards, Andreas Bießmann