Skip to content

Commit

Permalink
USB: usb-stor: realtek_cr: Fix compile error
Browse files Browse the repository at this point in the history
To fix the compile error when CONFIG_PM_RUNTIME is not enabled,
move the declaration of us out of CONFIG_REALTEK_AUTOPM macro in rts51x_chip.

drivers/usb/storage/realtek_cr.c: In function 'realtek_cr_destructor':
drivers/usb/storage/realtek_cr.c:942:11: error: 'struct rts51x_chip' has no member named 'us'

Signed-off-by: Wei WANG <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Wei WANG authored and gregkh committed May 17, 2013
1 parent 7c8bfed commit 1c9e55c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/storage/realtek_cr.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ struct rts51x_chip {
int status_len;

u32 flag;
#ifdef CONFIG_REALTEK_AUTOPM
struct us_data *us;

#ifdef CONFIG_REALTEK_AUTOPM
struct timer_list rts51x_suspend_timer;
unsigned long timer_expires;
int pwr_state;
Expand Down Expand Up @@ -988,6 +989,7 @@ static int init_realtek_cr(struct us_data *us)
us->extra = chip;
us->extra_destructor = realtek_cr_destructor;
us->max_lun = chip->max_lun = rts51x_get_max_lun(us);
chip->us = us;

usb_stor_dbg(us, "chip->max_lun = %d\n", chip->max_lun);

Expand All @@ -1010,10 +1012,8 @@ static int init_realtek_cr(struct us_data *us)
SET_AUTO_DELINK(chip);
}
#ifdef CONFIG_REALTEK_AUTOPM
if (ss_en) {
chip->us = us;
if (ss_en)
realtek_cr_autosuspend_setup(us);
}
#endif

usb_stor_dbg(us, "chip->flag = 0x%x\n", chip->flag);
Expand Down

0 comments on commit 1c9e55c

Please sign in to comment.