staging: dwc2: add const to handling of dwc2_core_params
authorStephen Warren <swarren@wwwdotorg.org>
Mon, 29 Apr 2013 19:49:08 +0000 (19:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 22:23:56 +0000 (15:23 -0700)
Now the functions use proper const annotations, the global variable with
default params can be marked const, which prevents these values from
being changed for a specific device (in theory there could be multiple
controllers with different settings, for example).

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
[matthijs@stdin.nl: Split patch from bigger patch, marked
    dwc2_module_params in pci.c as const and added
    commit message]
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dwc2/core.c
drivers/staging/dwc2/hcd.c
drivers/staging/dwc2/hcd.h
drivers/staging/dwc2/pci.c

index 89b19d7804c80c40e1f1a480dc51ce30a1fe1de8..ac8ed15064dca6542768fa703f1c050ddd50a905 100644 (file)
@@ -2642,7 +2642,7 @@ int dwc2_set_param_otg_ver(struct dwc2_hsotg *hsotg, int val)
  * for the DWC_otg core. It returns non-0 if any parameters are invalid.
  */
 int dwc2_set_parameters(struct dwc2_hsotg *hsotg,
-                       struct dwc2_core_params *params)
+                       const struct dwc2_core_params *params)
 {
        int retval = 0;
 
index 772711234af7dba10e80026ed9061c879017c465..6a594a40f7a1ba9bcc86c2e083260031b10ed36e 100644 (file)
@@ -2701,7 +2701,7 @@ EXPORT_SYMBOL_GPL(dwc2_set_all_params);
  * a negative error on failure.
  */
 int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
-                 struct dwc2_core_params *params)
+                 const struct dwc2_core_params *params)
 {
        struct usb_hcd *hcd;
        struct dwc2_host_chan *channel;
index 88b707e4ab72404cb2a87fadf2293529c633a8e8..cf6c055aec8d1384842c628543d143e18f974d7d 100644 (file)
@@ -448,10 +448,10 @@ static inline u8 dwc2_hcd_is_pipe_out(struct dwc2_hcd_pipe_info *pipe)
 }
 
 extern int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
-                        struct dwc2_core_params *params);
+                        const struct dwc2_core_params *params);
 extern void dwc2_hcd_remove(struct dwc2_hsotg *hsotg);
 extern int dwc2_set_parameters(struct dwc2_hsotg *hsotg,
-                              struct dwc2_core_params *params);
+                              const struct dwc2_core_params *params);
 extern void dwc2_set_all_params(struct dwc2_core_params *params, int value);
 
 /* Transaction Execution Functions */
index 69c65eb8683fb01db49992a2d27936287570e062..12ae24b1c0ab6eab60e964e66c273486198dfb99 100644 (file)
@@ -59,7 +59,7 @@
 
 static const char dwc2_driver_name[] = "dwc2";
 
-static struct dwc2_core_params dwc2_module_params = {
+static const struct dwc2_core_params dwc2_module_params = {
        .otg_cap                        = -1,
        .otg_ver                        = -1,
        .dma_enable                     = -1,