From patchwork Fri Aug 13 12:27:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12435527 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E89AC4320A for ; Fri, 13 Aug 2021 12:27:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52ECE610A4 for ; Fri, 13 Aug 2021 12:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240474AbhHMM2P (ORCPT ); Fri, 13 Aug 2021 08:28:15 -0400 Received: from mga14.intel.com ([192.55.52.115]:5785 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbhHMM2O (ORCPT ); Fri, 13 Aug 2021 08:28:14 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10074"; a="215280354" X-IronPort-AV: E=Sophos;i="5.84,318,1620716400"; d="scan'208";a="215280354" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2021 05:27:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,318,1620716400"; d="scan'208";a="639793620" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 13 Aug 2021 05:27:45 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6087DF9; Fri, 13 Aug 2021 15:27:45 +0300 (EEST) From: Andy Shevchenko To: Jonathan Lemon , Andy Shevchenko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Richard Cochran Subject: [PATCH v1 net-next 1/3] ptp_ocp: Switch to use module_pci_driver() macro Date: Fri, 13 Aug 2021 15:27:35 +0300 Message-Id: <20210813122737.45860-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Eliminate some boilerplate code by using module_pci_driver() instead of init/exit, and, if needed, moving the salient bits from init into probe. Signed-off-by: Andy Shevchenko --- drivers/ptp/ptp_ocp.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index 0d1034e3ed0f..874ea7930079 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -377,24 +376,7 @@ static struct pci_driver ptp_ocp_driver = { .probe = ptp_ocp_probe, .remove = ptp_ocp_remove, }; - -static int __init -ptp_ocp_init(void) -{ - int err; - - err = pci_register_driver(&ptp_ocp_driver); - return err; -} - -static void __exit -ptp_ocp_fini(void) -{ - pci_unregister_driver(&ptp_ocp_driver); -} - -module_init(ptp_ocp_init); -module_exit(ptp_ocp_fini); +module_pci_driver(ptp_ocp_driver); MODULE_DESCRIPTION("OpenCompute TimeCard driver"); MODULE_LICENSE("GPL v2");