Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: hns: hnae: remove unnecessary __module_get() and module_put()

hnae_ae_register() is called from hns_dsaf_probe(), the refcount of
module hnae has already be got in resolve_symbol() while calling the
function, so the __module_get()/module_put() can be removed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yang Yingliang and committed by
David S. Miller
47aeed9d 738136a0

-3
-3
drivers/net/ethernet/hisilicon/hns/hnae.c
··· 424 424 return ret; 425 425 } 426 426 427 - __module_get(THIS_MODULE); 428 - 429 427 INIT_LIST_HEAD(&hdev->handle_list); 430 428 spin_lock_init(&hdev->lock); 431 429 ··· 443 445 void hnae_ae_unregister(struct hnae_ae_dev *hdev) 444 446 { 445 447 device_unregister(&hdev->cls_dev); 446 - module_put(THIS_MODULE); 447 448 } 448 449 EXPORT_SYMBOL(hnae_ae_unregister); 449 450