@@ -168,7 +168,9 @@ static int fw_cache_piggyback_on_request(const char *name);
168168
169169static struct fw_priv * __allocate_fw_priv (const char * fw_name ,
170170 struct firmware_cache * fwc ,
171- void * dbuf , size_t size )
171+ void * dbuf ,
172+ size_t size ,
173+ u32 opt_flags )
172174{
173175 struct fw_priv * fw_priv ;
174176
@@ -186,6 +188,7 @@ static struct fw_priv *__allocate_fw_priv(const char *fw_name,
186188 fw_priv -> fwc = fwc ;
187189 fw_priv -> data = dbuf ;
188190 fw_priv -> allocated_size = size ;
191+ fw_priv -> opt_flags = opt_flags ;
189192 fw_state_init (fw_priv );
190193#ifdef CONFIG_FW_LOADER_USER_HELPER
191194 INIT_LIST_HEAD (& fw_priv -> pending_list );
@@ -210,8 +213,10 @@ static struct fw_priv *__lookup_fw_priv(const char *fw_name)
210213/* Returns 1 for batching firmware requests with the same name */
211214static int alloc_lookup_fw_priv (const char * fw_name ,
212215 struct firmware_cache * fwc ,
213- struct fw_priv * * fw_priv , void * dbuf ,
214- size_t size , u32 opt_flags )
216+ struct fw_priv * * fw_priv ,
217+ void * dbuf ,
218+ size_t size ,
219+ u32 opt_flags )
215220{
216221 struct fw_priv * tmp ;
217222
@@ -227,7 +232,7 @@ static int alloc_lookup_fw_priv(const char *fw_name,
227232 }
228233 }
229234
230- tmp = __allocate_fw_priv (fw_name , fwc , dbuf , size );
235+ tmp = __allocate_fw_priv (fw_name , fwc , dbuf , size , opt_flags );
231236 if (tmp ) {
232237 INIT_LIST_HEAD (& tmp -> list );
233238 if (!(opt_flags & FW_OPT_NOCACHE ))
@@ -640,7 +645,7 @@ static int fw_add_devm_name(struct device *dev, const char *name)
640645}
641646#endif
642647
643- int assign_fw (struct firmware * fw , struct device * device , u32 opt_flags )
648+ int assign_fw (struct firmware * fw , struct device * device )
644649{
645650 struct fw_priv * fw_priv = fw -> priv ;
646651 int ret ;
@@ -659,8 +664,8 @@ int assign_fw(struct firmware *fw, struct device *device, u32 opt_flags)
659664 * should be fixed in devres or driver core.
660665 */
661666 /* don't cache firmware handled without uevent */
662- if (device && (opt_flags & FW_OPT_UEVENT ) &&
663- !(opt_flags & FW_OPT_NOCACHE )) {
667+ if (device && (fw_priv -> opt_flags & FW_OPT_UEVENT ) &&
668+ !(fw_priv -> opt_flags & FW_OPT_NOCACHE )) {
664669 ret = fw_add_devm_name (device , fw_priv -> fw_name );
665670 if (ret ) {
666671 mutex_unlock (& fw_lock );
@@ -672,7 +677,7 @@ int assign_fw(struct firmware *fw, struct device *device, u32 opt_flags)
672677 * After caching firmware image is started, let it piggyback
673678 * on request firmware.
674679 */
675- if (!(opt_flags & FW_OPT_NOCACHE ) &&
680+ if (!(fw_priv -> opt_flags & FW_OPT_NOCACHE ) &&
676681 fw_priv -> fwc -> state == FW_LOADER_START_CACHE ) {
677682 if (fw_cache_piggyback_on_request (fw_priv -> fw_name ))
678683 kref_get (& fw_priv -> ref );
@@ -783,7 +788,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
783788#endif
784789
785790 if (ret == - ENOENT )
786- ret = firmware_fallback_platform (fw -> priv , opt_flags );
791+ ret = firmware_fallback_platform (fw -> priv );
787792
788793 if (ret ) {
789794 if (!(opt_flags & FW_OPT_NO_WARN ))
@@ -792,7 +797,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
792797 name , ret );
793798 ret = firmware_fallback_sysfs (fw , name , device , opt_flags , ret );
794799 } else
795- ret = assign_fw (fw , device , opt_flags );
800+ ret = assign_fw (fw , device );
796801
797802 out :
798803 if (ret < 0 ) {
0 commit comments