@@ -300,7 +300,7 @@ static int brcmf_feat_fwcap_debugfs_read(struct seq_file *seq, void *data)
300300 return 0 ;
301301}
302302
303- void brcmf_feat_attach (struct brcmf_pub * drvr )
303+ int brcmf_feat_attach (struct brcmf_pub * drvr )
304304{
305305 struct brcmf_if * ifp = brcmf_get_ifp (drvr , 0 );
306306 struct brcmf_join_version_le join_ver ;
@@ -361,13 +361,14 @@ void brcmf_feat_attach(struct brcmf_pub *drvr)
361361 err = brcmf_fil_iovar_data_get (ifp , "join_ver" , & join_ver , sizeof (join_ver ));
362362 if (!err ) {
363363 u16 ver = le16_to_cpu (join_ver .join_ver_major );
364- brcmf_join_param_setup_for_version (drvr , ver );
364+ err = brcmf_join_param_setup_for_version (drvr , ver );
365365 } else {
366366 /* Default to version 0, unless it is one of the firmware branches
367367 * that doesn't have a join_ver iovar but are still version 1 */
368368 u8 version = 0 ;
369369 struct brcmf_wlc_version_le ver ;
370- err = brcmf_fil_iovar_data_get (ifp , "wlc_ver" , & ver , sizeof (ver ));
370+ err = brcmf_fil_iovar_data_get (ifp , "wlc_ver" , & ver ,
371+ sizeof (ver ));
371372 if (!err ) {
372373 u16 major = le16_to_cpu (ver .wlc_ver_major );
373374 u16 minor = le16_to_cpu (ver .wlc_ver_minor );
@@ -380,27 +381,42 @@ void brcmf_feat_attach(struct brcmf_pub *drvr)
380381 version = 1 ;
381382 }
382383 }
383- brcmf_join_param_setup_for_version (drvr , version );
384+ err = brcmf_join_param_setup_for_version (drvr , version );
384385 }
385- err = brcmf_fil_iovar_data_get (ifp , "scan_ver" , & scan_ver , sizeof (scan_ver ));
386+ if (err ) {
387+ bphy_err (drvr , "Error setting up join structure handler: %d\n" ,
388+ err );
389+ return err ;
390+ }
391+ err = brcmf_fil_iovar_data_get (ifp , "scan_ver" , & scan_ver ,
392+ sizeof (scan_ver ));
386393 if (!err ) {
387394 u16 ver = le16_to_cpu (scan_ver .scan_ver_major );
388- brcmf_scan_param_setup_for_version (drvr , ver );
395+ err = brcmf_scan_param_setup_for_version (drvr , ver );
389396 } else {
390397 /* Default to version 1. */
391- brcmf_scan_param_setup_for_version (drvr , 1 );
398+ err = brcmf_scan_param_setup_for_version (drvr , 1 );
399+ }
400+ if (err ) {
401+ bphy_err (drvr , "Error setting up scan structure handler: %d\n" ,
402+ err );
403+ return err ;
392404 }
393-
394405 /* See what version of PFN scan is supported*/
395406 err = brcmf_fil_iovar_data_get (ifp , "pno_set" , & pno_params ,
396407 sizeof (pno_params ));
397408 if (!err ) {
398- brcmf_pno_setup_for_version (drvr , le16_to_cpu (pno_params .version ));
409+ err = brcmf_pno_setup_for_version (
410+ drvr , le16_to_cpu (pno_params .version ));
399411 } else {
400412 /* Default to version 2, supported by all chips we support. */
401- brcmf_pno_setup_for_version (drvr , 2 );
413+ err = brcmf_pno_setup_for_version (drvr , 2 );
414+ }
415+ if (err ) {
416+ bphy_err (drvr , "Error setting up escan structure handler: %d\n" ,
417+ err );
418+ return err ;
402419 }
403-
404420 if (drvr -> settings -> feature_disable ) {
405421 brcmf_dbg (INFO , "Features: 0x%02x, disable: 0x%02x\n" ,
406422 ifp -> drvr -> feat_flags ,
@@ -423,6 +439,7 @@ void brcmf_feat_attach(struct brcmf_pub *drvr)
423439 /* no quirks */
424440 break ;
425441 }
442+ return 0 ;
426443}
427444
428445void brcmf_feat_debugfs_create (struct brcmf_pub * drvr )
0 commit comments