From patchwork Sat Apr 21 10:58:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 10354065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E9AF60231 for ; Sat, 21 Apr 2018 11:00:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01E02288FC for ; Sat, 21 Apr 2018 11:00:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E539E2890E; Sat, 21 Apr 2018 11:00:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71626288FC for ; Sat, 21 Apr 2018 11:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbeDULAa (ORCPT ); Sat, 21 Apr 2018 07:00:30 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6758 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751462AbeDULA3 (ORCPT ); Sat, 21 Apr 2018 07:00:29 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 225167E6FE631; Sat, 21 Apr 2018 19:00:15 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Sat, 21 Apr 2018 19:00:10 +0800 From: YueHaibing To: , CC: , , YueHaibing Subject: [PATCH 1/3] am53c974: Using module_pci_driver. Date: Sat, 21 Apr 2018 18:58:33 +0800 Message-ID: <20180421105835.20764-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove boilerplate code by using macro module_pci_driver. Signed-off-by: YueHaibing --- drivers/scsi/am53c974.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c index beea30e..d81ca66 100644 --- a/drivers/scsi/am53c974.c +++ b/drivers/scsi/am53c974.c @@ -556,15 +556,7 @@ static struct pci_driver am53c974_driver = { .remove = pci_esp_remove_one, }; -static int __init am53c974_module_init(void) -{ - return pci_register_driver(&am53c974_driver); -} - -static void __exit am53c974_module_exit(void) -{ - pci_unregister_driver(&am53c974_driver); -} +module_pci_driver(am53c974_driver); MODULE_DESCRIPTION("AM53C974 SCSI driver"); MODULE_AUTHOR("Hannes Reinecke "); @@ -577,6 +569,3 @@ MODULE_PARM_DESC(am53c974_debug, "Enable debugging"); module_param(am53c974_fenab, bool, 0444); MODULE_PARM_DESC(am53c974_fenab, "Enable 24-bit DMA transfer sizes"); - -module_init(am53c974_module_init); -module_exit(am53c974_module_exit);