net: hns3: Change return type of hnae3_register_ae_algo
The ae_algo is used by many ae_devs. It is not only belong to just a ae_dev. Initializing ae_dev failed does not represent registering ae_algo failed. Because the action of registering ae_algo just is adding ae_algo to the ae_algo list and it is always is true, it make no sense to define return type as int. This patch changes the return type of hnae3_register_ae_algo 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>
This commit is contained in:
parent
50fbc237b7
commit
854cf33a63
|
@ -121,7 +121,7 @@ EXPORT_SYMBOL(hnae3_unregister_client);
|
|||
* @ae_algo: AE algorithm
|
||||
* NOTE: the duplicated name will not be checked
|
||||
*/
|
||||
int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo)
|
||||
void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo)
|
||||
{
|
||||
const struct pci_device_id *id;
|
||||
struct hnae3_ae_dev *ae_dev;
|
||||
|
@ -160,8 +160,6 @@ int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo)
|
|||
}
|
||||
|
||||
mutex_unlock(&hnae3_common_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(hnae3_register_ae_algo);
|
||||
|
||||
|
|
|
@ -519,7 +519,7 @@ void hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev);
|
|||
void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev);
|
||||
|
||||
void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo);
|
||||
int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo);
|
||||
void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo);
|
||||
|
||||
void hnae3_unregister_client(struct hnae3_client *client);
|
||||
int hnae3_register_client(struct hnae3_client *client);
|
||||
|
|
|
@ -6250,7 +6250,9 @@ static int hclge_init(void)
|
|||
{
|
||||
pr_info("%s is initializing\n", HCLGE_NAME);
|
||||
|
||||
return hnae3_register_ae_algo(&ae_algo);
|
||||
hnae3_register_ae_algo(&ae_algo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hclge_exit(void)
|
||||
|
|
|
@ -1852,7 +1852,9 @@ static int hclgevf_init(void)
|
|||
{
|
||||
pr_info("%s is initializing\n", HCLGEVF_NAME);
|
||||
|
||||
return hnae3_register_ae_algo(&ae_algovf);
|
||||
hnae3_register_ae_algo(&ae_algovf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hclgevf_exit(void)
|
||||
|
|
Loading…
Reference in New Issue