diff options
author | John Youn <John.Youn@synopsys.com> | 2017-01-17 23:30:27 -0500 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-01-24 04:04:18 -0500 |
commit | 9da5197475a09e51a467388308f14dcbdcee8ba9 (patch) | |
tree | b1c4aa514bacc1abbd33b6cdffcb04db3e0b1908 /drivers/usb/dwc2/core.c | |
parent | 33e4c1a9987a1fc3b42c3b534100b5b006d55c61 (diff) |
usb: dwc2: Cleanup some checkpatch issues
This commmit is the result of running checkpatch --fix.
The results were verified for correctness. Some of the fixes result in
line over 80 char which we will fix manually later.
The following is a summary of what was done by checkpatch:
* Remove externs on function prototypes.
* Replace symbolic permissions with octal.
* Align code to open parens.
* Replace 'unsigned' with 'unsigned int'.
* Remove unneccessary blank lines.
* Add blank lines after declarations.
* Add spaces around operators.
* Remove unnecessary spaces after casts.
* Replace 'x == NULL' with '!x'.
* Replace kzalloc() with kcalloc().
* Concatenate multi-line strings.
* Use the BIT() macro.
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2/core.c')
-rw-r--r-- | drivers/usb/dwc2/core.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 11d8ae9aead1..0446f3d6d54a 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c | |||
@@ -104,7 +104,7 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg) | |||
104 | gr = &hsotg->gr_backup; | 104 | gr = &hsotg->gr_backup; |
105 | if (!gr->valid) { | 105 | if (!gr->valid) { |
106 | dev_err(hsotg->dev, "%s: no global registers to restore\n", | 106 | dev_err(hsotg->dev, "%s: no global registers to restore\n", |
107 | __func__); | 107 | __func__); |
108 | return -EINVAL; | 108 | return -EINVAL; |
109 | } | 109 | } |
110 | gr->valid = false; | 110 | gr->valid = false; |
@@ -155,21 +155,21 @@ int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore) | |||
155 | ret = dwc2_restore_global_registers(hsotg); | 155 | ret = dwc2_restore_global_registers(hsotg); |
156 | if (ret) { | 156 | if (ret) { |
157 | dev_err(hsotg->dev, "%s: failed to restore registers\n", | 157 | dev_err(hsotg->dev, "%s: failed to restore registers\n", |
158 | __func__); | 158 | __func__); |
159 | return ret; | 159 | return ret; |
160 | } | 160 | } |
161 | if (dwc2_is_host_mode(hsotg)) { | 161 | if (dwc2_is_host_mode(hsotg)) { |
162 | ret = dwc2_restore_host_registers(hsotg); | 162 | ret = dwc2_restore_host_registers(hsotg); |
163 | if (ret) { | 163 | if (ret) { |
164 | dev_err(hsotg->dev, "%s: failed to restore host registers\n", | 164 | dev_err(hsotg->dev, "%s: failed to restore host registers\n", |
165 | __func__); | 165 | __func__); |
166 | return ret; | 166 | return ret; |
167 | } | 167 | } |
168 | } else { | 168 | } else { |
169 | ret = dwc2_restore_device_registers(hsotg); | 169 | ret = dwc2_restore_device_registers(hsotg); |
170 | if (ret) { | 170 | if (ret) { |
171 | dev_err(hsotg->dev, "%s: failed to restore device registers\n", | 171 | dev_err(hsotg->dev, "%s: failed to restore device registers\n", |
172 | __func__); | 172 | __func__); |
173 | return ret; | 173 | return ret; |
174 | } | 174 | } |
175 | } | 175 | } |
@@ -195,7 +195,7 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg) | |||
195 | ret = dwc2_backup_global_registers(hsotg); | 195 | ret = dwc2_backup_global_registers(hsotg); |
196 | if (ret) { | 196 | if (ret) { |
197 | dev_err(hsotg->dev, "%s: failed to backup global registers\n", | 197 | dev_err(hsotg->dev, "%s: failed to backup global registers\n", |
198 | __func__); | 198 | __func__); |
199 | return ret; | 199 | return ret; |
200 | } | 200 | } |
201 | 201 | ||
@@ -203,14 +203,14 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg) | |||
203 | ret = dwc2_backup_host_registers(hsotg); | 203 | ret = dwc2_backup_host_registers(hsotg); |
204 | if (ret) { | 204 | if (ret) { |
205 | dev_err(hsotg->dev, "%s: failed to backup host registers\n", | 205 | dev_err(hsotg->dev, "%s: failed to backup host registers\n", |
206 | __func__); | 206 | __func__); |
207 | return ret; | 207 | return ret; |
208 | } | 208 | } |
209 | } else { | 209 | } else { |
210 | ret = dwc2_backup_device_registers(hsotg); | 210 | ret = dwc2_backup_device_registers(hsotg); |
211 | if (ret) { | 211 | if (ret) { |
212 | dev_err(hsotg->dev, "%s: failed to backup device registers\n", | 212 | dev_err(hsotg->dev, "%s: failed to backup device registers\n", |
213 | __func__); | 213 | __func__); |
214 | return ret; | 214 | return ret; |
215 | } | 215 | } |
216 | } | 216 | } |
@@ -793,7 +793,7 @@ void dwc2_disable_global_interrupts(struct dwc2_hsotg *hsotg) | |||
793 | } | 793 | } |
794 | 794 | ||
795 | /* Returns the controller's GHWCFG2.OTG_MODE. */ | 795 | /* Returns the controller's GHWCFG2.OTG_MODE. */ |
796 | unsigned dwc2_op_mode(struct dwc2_hsotg *hsotg) | 796 | unsigned int dwc2_op_mode(struct dwc2_hsotg *hsotg) |
797 | { | 797 | { |
798 | u32 ghwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); | 798 | u32 ghwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); |
799 | 799 | ||
@@ -804,7 +804,7 @@ unsigned dwc2_op_mode(struct dwc2_hsotg *hsotg) | |||
804 | /* Returns true if the controller is capable of DRD. */ | 804 | /* Returns true if the controller is capable of DRD. */ |
805 | bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg) | 805 | bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg) |
806 | { | 806 | { |
807 | unsigned op_mode = dwc2_op_mode(hsotg); | 807 | unsigned int op_mode = dwc2_op_mode(hsotg); |
808 | 808 | ||
809 | return (op_mode == GHWCFG2_OP_MODE_HNP_SRP_CAPABLE) || | 809 | return (op_mode == GHWCFG2_OP_MODE_HNP_SRP_CAPABLE) || |
810 | (op_mode == GHWCFG2_OP_MODE_SRP_ONLY_CAPABLE) || | 810 | (op_mode == GHWCFG2_OP_MODE_SRP_ONLY_CAPABLE) || |
@@ -814,7 +814,7 @@ bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg) | |||
814 | /* Returns true if the controller is host-only. */ | 814 | /* Returns true if the controller is host-only. */ |
815 | bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg) | 815 | bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg) |
816 | { | 816 | { |
817 | unsigned op_mode = dwc2_op_mode(hsotg); | 817 | unsigned int op_mode = dwc2_op_mode(hsotg); |
818 | 818 | ||
819 | return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_HOST) || | 819 | return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_HOST) || |
820 | (op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_HOST); | 820 | (op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_HOST); |
@@ -823,7 +823,7 @@ bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg) | |||
823 | /* Returns true if the controller is device-only. */ | 823 | /* Returns true if the controller is device-only. */ |
824 | bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg) | 824 | bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg) |
825 | { | 825 | { |
826 | unsigned op_mode = dwc2_op_mode(hsotg); | 826 | unsigned int op_mode = dwc2_op_mode(hsotg); |
827 | 827 | ||
828 | return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) || | 828 | return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) || |
829 | (op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_DEVICE); | 829 | (op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_DEVICE); |