mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Nipun Gupta <nipun.gupta@amd.com>,
	 Nikhil Agarwal <nikhil.agarwal@amd.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH v2 4/6] cdx: controller: Do not open-code module_platform_driver()
Date: Wed, 30 Apr 2025 20:41:32 +0200	[thread overview]
Message-ID: <20250430-cdx-clean-v2-4-7dbfda9364a9@linaro.org> (raw)
In-Reply-To: <20250430-cdx-clean-v2-0-7dbfda9364a9@linaro.org>

Replace standard platform_driver_register() boilerplate with
module_platform_driver() to make code smaller.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/cdx/controller/cdx_controller.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index fce90926d3378ae60166426cbf8e4a4fe014af86..bfb5ac2d861f2708214ae28922a7c0cfdcdf5cc6 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -250,24 +250,7 @@ static struct platform_driver cdx_pdriver = {
 	.remove = xlnx_cdx_remove,
 };
 
-static int __init cdx_controller_init(void)
-{
-	int ret;
-
-	ret = platform_driver_register(&cdx_pdriver);
-	if (ret)
-		pr_err("platform_driver_register() failed: %d\n", ret);
-
-	return ret;
-}
-
-static void __exit cdx_controller_exit(void)
-{
-	platform_driver_unregister(&cdx_pdriver);
-}
-
-module_init(cdx_controller_init);
-module_exit(cdx_controller_exit);
+module_platform_driver(cdx_pdriver);
 
 MODULE_AUTHOR("AMD Inc.");
 MODULE_DESCRIPTION("CDX controller for AMD devices");

-- 
2.45.2


  parent reply	other threads:[~2025-04-30 18:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 18:41 [PATCH v2 0/6] cdx: Minor cleanups Krzysztof Kozlowski
2025-04-30 18:41 ` [PATCH v2 1/6] cdx: Enable compile testing Krzysztof Kozlowski
2025-04-30 18:41 ` [PATCH v2 2/6] cdx: controller: Simplify with dev_err_probe() Krzysztof Kozlowski
2025-04-30 18:41 ` [PATCH v2 3/6] cdx: controller: Drop useless probe success message Krzysztof Kozlowski
2025-04-30 18:41 ` Krzysztof Kozlowski [this message]
2025-04-30 18:41 ` [PATCH v2 5/6] cdx: controller: Drop unneeded driver.pm NULL assignment Krzysztof Kozlowski
2025-04-30 18:41 ` [PATCH v2 6/6] cdx: MAINTAINERS: Explicitly mention Greg who handles patches Krzysztof Kozlowski
2025-05-01 15:59   ` Greg Kroah-Hartman
2025-05-01 16:06     ` Krzysztof Kozlowski
2025-05-02  6:27       ` Krzysztof Kozlowski
2025-05-02  6:52         ` Gupta, Nipun
2025-05-02  6:57           ` Krzysztof Kozlowski
2025-05-02  7:17             ` Greg Kroah-Hartman
2025-05-02  7:52               ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250430-cdx-clean-v2-4-7dbfda9364a9@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikhil.agarwal@amd.com \
    --cc=nipun.gupta@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®