Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364127
b: refs/heads/master
c: 8284f93
h: refs/heads/master
i:
  364125: f7f97e3
  364123: 6202118
  364119: 120a899
  364111: 1cba4aa
  364095: 707dbb3
v: v3
  • Loading branch information
Matthijs Kooijman authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 8512689 commit cacb102
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 050232a73c0d054750a9da92e071e26d4c571f12
refs/heads/master: 8284f93b3d8b21e30bd8fde97686433a52b49c58
4 changes: 4 additions & 0 deletions trunk/drivers/staging/dwc2/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ enum dwc2_lx_state {
* parameters define how the DWC_otg controller should be configured.
*/
struct dwc2_core_params {
/*
* Don't add any non-int members here, this will break
* dwc2_set_all_params!
*/
int otg_cap;
int otg_ver;
int dma_enable;
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/staging/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2679,8 +2679,15 @@ static void dwc2_hcd_release(struct dwc2_hsotg *hsotg)
dwc2_hcd_free(hsotg);
}

static void dwc2_set_uninitialized(int *p, int size)
/*
* Sets all parameters to the given value.
*
* Assumes that the dwc2_core_params struct contains only integers.
*/
void dwc2_set_all_params(struct dwc2_core_params *params, int value)
{
int *p = (int *)params;
size_t size = sizeof(*params) / sizeof(*p);
int i;

for (i = 0; i < size; i++)
Expand Down Expand Up @@ -2789,8 +2796,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
if (!hsotg->core_params)
goto error1;

dwc2_set_uninitialized((int *)hsotg->core_params,
sizeof(*hsotg->core_params) / sizeof(int));
dwc2_set_all_params(hsotg->core_params, -1);

/* Validate parameter values */
dwc2_set_parameters(hsotg, params);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/dwc2/hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ extern int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
extern void dwc2_hcd_remove(struct dwc2_hsotg *hsotg);
extern int dwc2_set_parameters(struct dwc2_hsotg *hsotg,
struct dwc2_core_params *params);
extern void dwc2_set_all_params(struct dwc2_core_params *params, int value);

/* Transaction Execution Functions */
extern enum dwc2_transaction_type dwc2_hcd_select_transactions(
Expand Down

0 comments on commit cacb102

Please sign in to comment.