]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
usb: ulpi: make ops struct constant
authorTal Shorer <tal.shorer@gmail.com>
Tue, 16 Aug 2016 16:04:52 +0000 (19:04 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 6 Sep 2016 07:47:25 +0000 (10:47 +0300)
None of the core ulpi functions perform any changes to the operations
struct, and logically as a struct that contains function pointers
there's no reason it shouldn't be constant.

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Tal Shorer <tal.shorer@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/common/ulpi.c
include/linux/ulpi/driver.h
include/linux/ulpi/interface.h

index 0439e963881357f9e5a294ee21a2701b3a420396..d4ff6df859eb3956fd8840541619d6b87157c173 100644 (file)
@@ -202,7 +202,8 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
  * Allocates and registers a ULPI device and an interface for it. Called from
  * the USB controller that provides the ULPI interface.
  */
-struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi_ops *ops)
+struct ulpi *ulpi_register_interface(struct device *dev,
+                                    const struct ulpi_ops *ops)
 {
        struct ulpi *ulpi;
        int ret;
index 388f6e08b9d451dfbb360b544e766834d57d3398..a44408f6d53225a9d497e29804d1d0163f4d59c1 100644 (file)
@@ -15,7 +15,7 @@ struct ulpi_ops;
  */
 struct ulpi {
        struct ulpi_device_id id;
-       struct ulpi_ops *ops;
+       const struct ulpi_ops *ops;
        struct device dev;
 };
 
index cdedac87ed482fb4ac2fabd17fdc5f3414cf5e6a..a2011a919eb61f39a1d1be6e01159b29b0e71113 100644 (file)
@@ -16,7 +16,7 @@ struct ulpi_ops {
        int (*write)(struct device *dev, u8 addr, u8 val);
 };
 
-struct ulpi *ulpi_register_interface(struct device *, struct ulpi_ops *);
+struct ulpi *ulpi_register_interface(struct device *, const struct ulpi_ops *);
 void ulpi_unregister_interface(struct ulpi *);
 
 #endif /* __LINUX_ULPI_INTERFACE_H */