Commit 1c9e55cda44d770ce4e519f9672a4f11e87a2160
Committed by
Greg Kroah-Hartman
1 parent
7c8bfed7aa
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
USB: usb-stor: realtek_cr: Fix compile error
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 <wei_wang@realsil.com.cn> Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
drivers/usb/storage/realtek_cr.c
... | ... | @@ -105,8 +105,9 @@ |
105 | 105 | int status_len; |
106 | 106 | |
107 | 107 | u32 flag; |
108 | -#ifdef CONFIG_REALTEK_AUTOPM | |
109 | 108 | struct us_data *us; |
109 | + | |
110 | +#ifdef CONFIG_REALTEK_AUTOPM | |
110 | 111 | struct timer_list rts51x_suspend_timer; |
111 | 112 | unsigned long timer_expires; |
112 | 113 | int pwr_state; |
... | ... | @@ -988,6 +989,7 @@ |
988 | 989 | us->extra = chip; |
989 | 990 | us->extra_destructor = realtek_cr_destructor; |
990 | 991 | us->max_lun = chip->max_lun = rts51x_get_max_lun(us); |
992 | + chip->us = us; | |
991 | 993 | |
992 | 994 | usb_stor_dbg(us, "chip->max_lun = %d\n", chip->max_lun); |
993 | 995 | |
994 | 996 | |
... | ... | @@ -1010,10 +1012,8 @@ |
1010 | 1012 | SET_AUTO_DELINK(chip); |
1011 | 1013 | } |
1012 | 1014 | #ifdef CONFIG_REALTEK_AUTOPM |
1013 | - if (ss_en) { | |
1014 | - chip->us = us; | |
1015 | + if (ss_en) | |
1015 | 1016 | realtek_cr_autosuspend_setup(us); |
1016 | - } | |
1017 | 1017 | #endif |
1018 | 1018 | |
1019 | 1019 | usb_stor_dbg(us, "chip->flag = 0x%x\n", chip->flag); |