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 @@ -345,6 +345,7 @@ struct igc_adapter {
345
345
/* LEDs */
346
346
struct mutex led_mutex ;
347
347
struct igc_led_classdev * leds ;
348
+ bool leds_available ;
348
349
};
349
350
350
351
void igc_up (struct igc_adapter * adapter );
Original file line number Diff line number Diff line change @@ -7335,8 +7335,14 @@ static int igc_probe(struct pci_dev *pdev,
7335
7335
7336
7336
if (IS_ENABLED (CONFIG_IGC_LEDS )) {
7337
7337
err = igc_led_setup (adapter );
7338
- if (err )
7339
- goto err_register ;
7338
+ if (err ) {
7339
+ netdev_warn_once (netdev ,
7340
+ "LED init failed (%d); continuing without LED support\n" ,
7341
+ err );
7342
+ adapter -> leds_available = false;
7343
+ } else {
7344
+ adapter -> leds_available = true;
7345
+ }
7340
7346
}
7341
7347
7342
7348
return 0 ;
@@ -7392,7 +7398,7 @@ static void igc_remove(struct pci_dev *pdev)
7392
7398
cancel_work_sync (& adapter -> watchdog_task );
7393
7399
hrtimer_cancel (& adapter -> hrtimer );
7394
7400
7395
- if (IS_ENABLED (CONFIG_IGC_LEDS ))
7401
+ if (IS_ENABLED (CONFIG_IGC_LEDS ) && adapter -> leds_available )
7396
7402
igc_led_free (adapter );
7397
7403
7398
7404
/* 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