File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
drivers/net/ethernet/intel/igc Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,7 @@ struct igc_adapter {
343
343
/* LEDs */
344
344
struct mutex led_mutex ;
345
345
struct igc_led_classdev * leds ;
346
+ bool leds_available ;
346
347
};
347
348
348
349
void igc_up (struct igc_adapter * adapter );
Original file line number Diff line number Diff line change @@ -7301,8 +7301,14 @@ static int igc_probe(struct pci_dev *pdev,
7301
7301
7302
7302
if (IS_ENABLED (CONFIG_IGC_LEDS )) {
7303
7303
err = igc_led_setup (adapter );
7304
- if (err )
7305
- goto err_register ;
7304
+ if (err ) {
7305
+ netdev_warn_once (netdev ,
7306
+ "LED init failed (%d); continuing without LED support\n" ,
7307
+ err );
7308
+ adapter -> leds_available = false;
7309
+ } else {
7310
+ adapter -> leds_available = true;
7311
+ }
7306
7312
}
7307
7313
7308
7314
return 0 ;
@@ -7358,7 +7364,7 @@ static void igc_remove(struct pci_dev *pdev)
7358
7364
cancel_work_sync (& adapter -> watchdog_task );
7359
7365
hrtimer_cancel (& adapter -> hrtimer );
7360
7366
7361
- if (IS_ENABLED (CONFIG_IGC_LEDS ))
7367
+ if (IS_ENABLED (CONFIG_IGC_LEDS ) && adapter -> leds_available )
7362
7368
igc_led_free (adapter );
7363
7369
7364
7370
/* Release control of h/w to f/w. If f/w is AMT enabled, this
You can’t perform that action at this time.
0 commit comments