Commit 854cf33a authored by Fuyun Liang's avatar Fuyun Liang Committed by David S. Miller

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: default avatarFuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50fbc237
...@@ -121,7 +121,7 @@ EXPORT_SYMBOL(hnae3_unregister_client); ...@@ -121,7 +121,7 @@ EXPORT_SYMBOL(hnae3_unregister_client);
* @ae_algo: AE algorithm * @ae_algo: AE algorithm
* NOTE: the duplicated name will not be checked * 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; const struct pci_device_id *id;
struct hnae3_ae_dev *ae_dev; struct hnae3_ae_dev *ae_dev;
...@@ -160,8 +160,6 @@ int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) ...@@ -160,8 +160,6 @@ int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo)
} }
mutex_unlock(&hnae3_common_lock); mutex_unlock(&hnae3_common_lock);
return ret;
} }
EXPORT_SYMBOL(hnae3_register_ae_algo); EXPORT_SYMBOL(hnae3_register_ae_algo);
......
...@@ -519,7 +519,7 @@ void hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev); ...@@ -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_dev(struct hnae3_ae_dev *ae_dev);
void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo); 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); void hnae3_unregister_client(struct hnae3_client *client);
int hnae3_register_client(struct hnae3_client *client); int hnae3_register_client(struct hnae3_client *client);
......
...@@ -6250,7 +6250,9 @@ static int hclge_init(void) ...@@ -6250,7 +6250,9 @@ static int hclge_init(void)
{ {
pr_info("%s is initializing\n", HCLGE_NAME); 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) static void hclge_exit(void)
......
...@@ -1852,7 +1852,9 @@ static int hclgevf_init(void) ...@@ -1852,7 +1852,9 @@ static int hclgevf_init(void)
{ {
pr_info("%s is initializing\n", HCLGEVF_NAME); 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) static void hclgevf_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment