Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: ftdi-elan.c: fixes and cleanups

This patch contains the following possible cleanups:
- make the needlessly global ftdi_release_platform_dev() static
- remove the unused usb_ftdi_elan_read_reg()
- proper prototypes for the following functions:
- usb_ftdi_elan_read_pcimem()
- usb_ftdi_elan_write_pcimem()

Note that the misplaced prototypes for the latter ones in
drivers/usb/host/u132-hcd.c were buggy. Depending on the calling
convention of the architecture calling one of them could have turned
your stack into garbage.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Adrian Bunk and committed by
Greg Kroah-Hartman
9ce8540c 27a3de4c

+6 -14
+1 -5
drivers/usb/host/u132-hcd.c
··· 205 205 struct u132_port port[MAX_U132_PORTS]; 206 206 struct u132_endp *endp[MAX_U132_ENDPS]; 207 207 }; 208 - int usb_ftdi_elan_read_reg(struct platform_device *pdev, u32 *data); 209 - int usb_ftdi_elan_read_pcimem(struct platform_device *pdev, u8 addressofs, 210 - u8 width, u32 *data); 211 - int usb_ftdi_elan_write_pcimem(struct platform_device *pdev, u8 addressofs, 212 - u8 width, u32 data); 208 + 213 209 /* 214 210 * these can not be inlines because we need the structure offset!! 215 211 * Does anyone have a better way?????
+1 -9
drivers/usb/misc/ftdi-elan.c
··· 303 303 304 304 305 305 EXPORT_SYMBOL_GPL(ftdi_elan_gone_away); 306 - void ftdi_release_platform_dev(struct device *dev) 306 + static void ftdi_release_platform_dev(struct device *dev) 307 307 { 308 308 dev->parent = NULL; 309 309 } ··· 1426 1426 } 1427 1427 } 1428 1428 1429 - int usb_ftdi_elan_read_reg(struct platform_device *pdev, u32 *data) 1430 - { 1431 - struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev); 1432 - return ftdi_elan_read_reg(ftdi, data); 1433 - } 1434 - 1435 - 1436 - EXPORT_SYMBOL_GPL(usb_ftdi_elan_read_reg); 1437 1429 static int ftdi_elan_read_config(struct usb_ftdi *ftdi, int config_offset, 1438 1430 u8 width, u32 *data) 1439 1431 {
+4
drivers/usb/misc/usb_u132.h
··· 95 95 int halted, int skipped, int actual, int non_null)); 96 96 int usb_ftdi_elan_edset_flush(struct platform_device *pdev, u8 ed_number, 97 97 void *endp); 98 + int usb_ftdi_elan_read_pcimem(struct platform_device *pdev, int mem_offset, 99 + u8 width, u32 *data); 100 + int usb_ftdi_elan_write_pcimem(struct platform_device *pdev, int mem_offset, 101 + u8 width, u32 data);