aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAge
...
| * | usb: gadgetfs: Convert semaphore to mutexThomas Gleixner2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semaphore data->lock is semantically a mutex. Convert it to a real mutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: g_mass_storage: superfluous and missing packets fixedMichal Nazarewicz2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mass storage function responded needlessly to a set configuration packet. This was a leftover from converting gadget (file storage gadget) into a composite function. Moreover, it has failed to respond to get max LUN request. Adding request queueing made the function work better. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: mass_storage: eject LUNs on thread exitMichal Nazarewicz2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a fallback which forces all LUNs ejection (including non-removable and with prevent_medium_removal flag) when mass storage function (MSF) worker thread exits and gadget fails to handle the situation. Previously, if thread_exits was not specified mass storage function (MSF) did nothing when exiting thread as it's unclear for *function* what to do when it's thread terminates so responsibility of handling this situation was left to the *gadget* using the function. The g_mass_storage handled the situation by unregistering itself (the same thing that file storage gadget does). However, g_multi did nothing and so MSF did not eject LUNs which prevented file system unmounting. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: disable double buffering for older RTL versionsCliff Cai2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to use double buffer modes in RTL versions <2.0 may result in infinite hangs or data corruption. So avoid them with older versions. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: set version of Blackfin versionCliff Cai2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All current Blackfin parts are using RTL v1.9, but they don't expose the hardware registers to probe this dynamically. So hardcode the version to v1.9 for now. Need to move the local hwvers related defines higher up in the header so that sub-musb headers may utilize them. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: pxa27x_udc: Fix deadlocks on request queueingRobert Jarzmik2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by Antonio, there are cases where the ep->lock can be taken twice, triggering a deadlock. The typical sequence is : irq_handler \ -> gadget.complete() \ -> pxa27x_udc.pxa_ep_queue() : ep->lock is taken \ -> gadget.complete() \ -> pxa27x_udc.pxa_ep_queue() : ep->lock is taken ==> *deadlock* The patch fixes this by : - releasing the lock each time gadget.complete() is called - adding a check in handle_ep() to detect a recursive call, in which case the function becomes on no-op. The patch is still not good enough for ep0. For this unique endpoint, another well thought over patch will be needed. Reported-by: Antonio Ospite <ospite@studenti.unina.it> Tested-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: serial: add support for serial port on the moschip 7715Mike Dunn2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the serial port on devices based on the MosChip 7715, which provides a serial and parallel port on a single usb interface. This is added to the existing driver for the Moschip 7720 dual serial port device. The 7715 is very similiar to the 7720, requiring only the addition of a calc_num_ports() function, a separate interrupt-in endpoint callback, and some manipulation of the port pointers added to the attach() function to correct the fact that the usbserial core erroneously assigns the first bulk in/out endpoint pair to the serial port (the 7715 uses these for its parallel port). There is no support for the 7715's parallel port yet. Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: io_edgeport: eliminate get_string()Dan Carpenter2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Johan Hovold points out that get_string() is basically just a re-implimentation of usb_string(). It is also buggy. It does DMA on the stack and it doesn't handle negative returns from usb_get_descriptor(). Plus unicode_to_ascii() is a rubbish function and moving to usb_string() avoids using it. Let's eliminate get_string() entirely. Reported-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: s3c-hsotg: replace deprecated dma_sync_single()FUJITA Tomonori2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces deprecated dma_sync_single() with dma_sync_single_for_cpu(). There is no functional change because dma_sync_single() simply calls dma_sync_single_for_cpu(): static inline void __deprecated dma_sync_single(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) { dma_sync_single_for_cpu(dev, addr, size, dir); } This fixes the following compile warnings: drivers/usb/gadget/s3c-hsotg.c: In function 's3c_hsotg_unmap_dma': drivers/usb/gadget/s3c-hsotg.c:376: warning: 'dma_sync_single' is deprecated (declared at /home/fujita/git/linux-2.6/include/linux/dma-mapping.h:109) drivers/usb/gadget/s3c-hsotg.c: In function 's3c_hsotg_map_dma': drivers/usb/gadget/s3c-hsotg.c:758: warning: 'dma_sync_single' is deprecated (declared at /home/fujita/git/linux-2.6/include/linux/dma-mapping.h:109) Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: only print info message if probe() is successfulFelipe Balbi2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we were printing the info about musb probe too early where it was still possible for things to go wrong. Move the down right before the return 0 statement. While at that also convert pr_info to dev_info. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: unmap base if we can't probeFelipe Balbi2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | when probe() fails, we should iounmap() the mapped address. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: tusb6010: use resource_sizeFelipe Balbi2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | Trivial patch, no functional changes. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: we already tested for dyn_fifoFelipe Balbi2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... and even added a flag to struct musb, so let's use that. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: musb: get rid of omap_readl/writelFelipe Balbi2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | we have those addresses already ioremaped, so let's use our __raw_readl/writel wrappers. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb: musb: Add context save and restore supportAjay Kumar Gupta2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding support for MUSB register save and restore during system suspend and resume. Changes: - Added musb_save/restore_context() functions - Added platform specific musb_platform_save/restore_context() to handle platform specific jobs. - Maintaining BlackFin compatibility by adding read/write functions for registers which are not available in BlackFin Tested system suspend and resume on OMAP3EVM board. Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: remove obsolete config in kernel source (USB_HCD_DMA)Christoph Egger2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The configuration Option USB_HCD_DMA is not reachable in KConfig so this piece of Code is effectively dead and useless. Remove it to avoid confusion. Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: usbfs_snoop: add data logging back inChris Frey2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | Uses the new snoop function from commit 4c6e8971cbe0148085, but includes the buffer data where appropriate, as before. Signed-off-by: Chris Frey <cdfrey@foursquare.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: s3c-hsotg: Staticise non-exported functionsMark Brown2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | Keeps sparse happy if nothing else. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: trivial: missing newline in usb core warning messageThadeu Lima de Souza Cascardo2010-03-02
| | | | | | | | | | | | | | | | | | Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: ftdi_sio: correct spelling in implementation fileAndreas Mohr2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - correct spelling - correct non-tabbed .tiocmget/.tiocmset entries Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: ftdi_sio: correct spelling in header filesAndreas Mohr2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | - correct spelling/whitespace in ftdi_sio.h and ftdi_sio_ids.h Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: serial: Eliminate useless codeJulia Lawall2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The variables priv and portdata are initialized twice to the same (side effect-free) expressions. Drop one initialization in each case. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // <smpl> @forall@ idexpression *x; identifier f!=ERR_PTR; @@ x = f(...) ... when != x ( x = f(...,<+...x...+>,...) | * x = f(...) ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: gadget: Add DEVTYPE support for Ethernet functionsMarcel Holtmann2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem with Ethernet based networking devices is to clearly identify what's their usage. Special interfaces like bridges, WiFi, Bluetooth, WiMAX or WWAN are already using DEVTYPE identification. This patch marks the Ethernet functions of gadgets from the device type "gadget". Automatic setup of these interfaces can now happen from userspace without the need of hardcoding the network interface name. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: remove the berry_charge driverGreg Kroah-Hartman2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Barry project's userspace program, bcharge, can better handle this device and functionality, and it also works with the latest phones, which this driver does not support. So remove it, as the userspace code should be used instead. Cc: Chris Frey <cdfrey@foursquare.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal from ioctl path of usbfsOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Total removal from the ioctl code path except for the outcall to external modules. Locking is ensured by the normal locks of usbfs. Signed-off-by: Oliver Neukum <oliver@neukum.org> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: vstusbOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: legousbtowerOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: ldusbOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: ftdi-elanOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: adutuxOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: idmouseOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: rio500Oliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver had used BKL to guard against disconnect but was incorrectly converted leaving an SMP race. BKL was added to disconnect() to fix this race BKL was removed from ioctl() as the mutex is sufficient on its own. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: mdc800Oliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: cdc-wdmOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: usbtmcOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: BKL removal: usb-skeletonOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | BKL not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb: BKL removal: usblpOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Acked-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: isight-firmware: declare MODULE_FIRMWAREBen Hutchings2010-03-02
| | | | | | | | | | | | | | | | | | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: Reduce scope of BKL in usb ioctl handlingOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | This pushes BKL down in ioctl handling and drops it for some important ioctls Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: Push BKL on open down into the driversOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Straightforward push into the drivers to allow auditing individual drivers separately Signed-off-by: Oliver Neukum <oliver@neukum.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: Remove BKL from lseek implementationsOliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace it by mutex_lock(&file->f_dentry->d_inode->i_mutex); following the example of the generic method Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: Remove BKL from usbdev_open()Oliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Locking had long been changed making BKL redundant. Simply remove it. Signed-off-by: Oliver Neukum <oliver@neukum.org> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: Remove BKL from poll()Oliver Neukum2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace BKL with usbfs_mutex to protect a global counter and a per file data structure Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: atm: Use FIELD_SIZEOF, trivial cleanup.Thiago Farina2010-03-02
| | | | | | | | | | | | | | | | | | Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: serial: option.c: Add 4G W14 stick to blacklist for option_send_setupGernot Hillier2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 4G XS Stick W14 seems to not understand RTS/DTR setting in option_send_setup causing long timeouts on any open() which disturbs a lot of well-known userspace applications like minicom or ModemManager. Therefore, we enable OPTION_BLACKLIST_SENDSETUP blacklisting for it. Signed-off-by: Gernot Hillier <gernot@hillier.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: serial: option.c: Add blacklisting infrastructure for special device ↵Gernot Hillier2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handling As suggested by Matthias Urlichs, this patch adds a somehow generic mechanism for special handling of devices which don't support all bits expected by this driver. The blacklisting code is heavily stolen from sierra.c, but extended to support different special cases. For now, one case is implemented (OPTION_BLACKLIST_SENDSETUP), targeted at the 4G W14 device: devices which don't understand the setting of RTS/DTR in option_send_setup() causing a USB timeout of 5 s in any userspace open() which leads to errors in most userspace applications. In addition, I prepared another case for devices with interfaces which shall not be accessed by this driver (targeted at the D-Link DWM 652). However, OPTION_BLACKLIST_RESERVED_IF is not fully implemented yet as I have no device to test this. Anyone volunteering to help here? If not, I'll contact the guys who added D-Link DWM 652 support soon. Signed-off-by: Gernot Hillier <gernot@hillier.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: serial: option.c: Add chipset information for 4G W14Gernot Hillier2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Carsten Juttner thankfully investigated a bit and found out some details about the chipset used in the 4G W14 device I recently added to option.c. I think this information is useful for reference, so I'd be happy if you could include those bits. Signed-off-by: Gernot Hillier <gernot@hillier.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB goku_udc: make PCI device id constantNémeth Márton2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The id_table field of the struct pci_driver is constant in <linux/pci.h> so it is worth to make pci_ids also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Németh Márton <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Cc: cocci@diku.dk Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB gadget: make Open Firmware device id constantNémeth Márton2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The match_table field of the struct of_device_id is constant in <linux/of_platform.h> so it is worth to make ace_of_match also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Németh Márton <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Cc: cocci@diku.dk Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB host: make Open Firmware device id constantNémeth Márton2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The match_table field of the struct of_device_id is constant in <linux/of_platform.h> so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Németh Márton <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Cc: cocci@diku.dk Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>