net: hns3: Change return type of hnae3_register_ae_dev
authorFuyun Liang <liangfuyun1@huawei.com>
Tue, 15 May 2018 18:20:08 +0000 (19:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 15:33:07 +0000 (11:33 -0400)
commit50fbc237b75720ca08d1fd9c6408cfe5c2217bbf
tree4da4ea6742cdff54235a5ac0f64dc475ad4f721b
parente3afa96365c916319a1068ac50b838b2256cc6df
net: hns3: Change return type of hnae3_register_ae_dev

If hclge.ko has not been inserted, the value of ret always is zero
in hnae3_register_ae_dev. If hclge.ko has been inserted, the value
of ret is zero or non zero. Different execution ways have different
results. It is confusing.

The ae_dev which is initialized failed can be reinitialized when we
remove hclge.ko and insert it again. For the case initializing client
instance, it is just like the case initializing ae_dev. The main function
of hnae3_register_ae_dev is adding the ae_dev to ad_dev list. Because
adding ae_dev is always ok, we does not need to return any in this
function.

This patch changes the return type of hnae3_register_ae_dev from int
to void.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.c
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c