sfc: Change falcon_probe_board() to fail for unsupported boards

The driver needs specific PHY and board support code for each SFC4000
board; there is no point trying to continue if it is missing.
Currently unsupported boards can trigger an 'oops'.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Ben Hutchings and committed by David S. Miller e41c11ee f49a4589

+7 -12
+3 -1
drivers/net/sfc/falcon.c
··· 1320 1320 1321 1321 EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad); 1322 1322 1323 - falcon_probe_board(efx, board_rev); 1323 + rc = falcon_probe_board(efx, board_rev); 1324 + if (rc) 1325 + goto fail2; 1324 1326 1325 1327 kfree(nvconfig); 1326 1328 return 0;
+3 -10
drivers/net/sfc/falcon_boards.c
··· 728 728 }, 729 729 }; 730 730 731 - static const struct falcon_board_type falcon_dummy_board = { 732 - .init = efx_port_dummy_op_int, 733 - .init_phy = efx_port_dummy_op_void, 734 - .fini = efx_port_dummy_op_void, 735 - .set_id_led = efx_port_dummy_op_set_id_led, 736 - .monitor = efx_port_dummy_op_int, 737 - }; 738 - 739 - void falcon_probe_board(struct efx_nic *efx, u16 revision_info) 731 + int falcon_probe_board(struct efx_nic *efx, u16 revision_info) 740 732 { 741 733 struct falcon_board *board = falcon_board(efx); 742 734 u8 type_id = FALCON_BOARD_TYPE(revision_info); ··· 746 754 (efx->pci_dev->subsystem_vendor == EFX_VENDID_SFC) 747 755 ? board->type->ref_model : board->type->gen_type, 748 756 'A' + board->major, board->minor); 757 + return 0; 749 758 } else { 750 759 EFX_ERR(efx, "unknown board type %d\n", type_id); 751 - board->type = &falcon_dummy_board; 760 + return -ENODEV; 752 761 } 753 762 }
+1 -1
drivers/net/sfc/nic.h
··· 156 156 ************************************************************************** 157 157 */ 158 158 159 - extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info); 159 + extern int falcon_probe_board(struct efx_nic *efx, u16 revision_info); 160 160 161 161 /* TX data path */ 162 162 extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue);