From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Li Yang <leoyang.li@nxp.com>, linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kernel@pengutronix.de, Arnd Bergmann <arnd@arndb.de>, linux-kbuild@vger.kernel.org Subject: [PATCH 2/6] usb: gadget: fsl-udc: Convert to use module_platform_driver() Date: Tue, 17 Oct 2023 22:44:45 +0200 [thread overview] Message-ID: <20231017204442.1625925-10-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20231017204442.1625925-8-u.kleine-koenig@pengutronix.de> module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index ee5705d336e3..2693a10eb0c7 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2666,6 +2666,7 @@ static const struct platform_device_id fsl_udc_devtype[] = { }; MODULE_DEVICE_TABLE(platform, fsl_udc_devtype); static struct platform_driver udc_driver = { + .probe = fsl_udc_probe, .remove = fsl_udc_remove, .id_table = fsl_udc_devtype, /* these suspend and resume are not usb suspend and resume */ @@ -2679,7 +2680,7 @@ static struct platform_driver udc_driver = { }, }; -module_platform_driver_probe(udc_driver, fsl_udc_probe); +module_platform_driver(udc_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR(DRIVER_AUTHOR); -- 2.42.0
WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Arnd Bergmann <arnd@arndb.de>, linux-kbuild@vger.kernel.org, linux-usb@vger.kernel.org, Li Yang <leoyang.li@nxp.com>, kernel@pengutronix.de, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/6] usb: gadget: fsl-udc: Convert to use module_platform_driver() Date: Tue, 17 Oct 2023 22:44:45 +0200 [thread overview] Message-ID: <20231017204442.1625925-10-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20231017204442.1625925-8-u.kleine-koenig@pengutronix.de> module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index ee5705d336e3..2693a10eb0c7 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2666,6 +2666,7 @@ static const struct platform_device_id fsl_udc_devtype[] = { }; MODULE_DEVICE_TABLE(platform, fsl_udc_devtype); static struct platform_driver udc_driver = { + .probe = fsl_udc_probe, .remove = fsl_udc_remove, .id_table = fsl_udc_devtype, /* these suspend and resume are not usb suspend and resume */ @@ -2679,7 +2680,7 @@ static struct platform_driver udc_driver = { }, }; -module_platform_driver_probe(udc_driver, fsl_udc_probe); +module_platform_driver(udc_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR(DRIVER_AUTHOR); -- 2.42.0
next prev parent reply other threads:[~2023-10-17 20:47 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-17 20:44 [PATCH 0/6] usb: gadget: Convert to use module_platform_driver() Uwe Kleine-König 2023-10-17 20:44 ` Uwe Kleine-König 2023-10-17 20:44 ` Uwe Kleine-König 2023-10-17 20:44 ` [PATCH 1/6] usb: gadget: at91-udc: " Uwe Kleine-König 2023-10-17 20:44 ` Uwe Kleine-König 2023-10-17 20:44 ` Uwe Kleine-König [this message] 2023-10-17 20:44 ` [PATCH 2/6] usb: gadget: fsl-udc: " Uwe Kleine-König 2023-10-17 20:44 ` [PATCH 3/6] usb: gadget: fusb300-udc: " Uwe Kleine-König 2023-10-17 20:44 ` [PATCH 4/6] usb: gadget: lpc32xx-udc: " Uwe Kleine-König 2023-10-17 20:44 ` Uwe Kleine-König 2023-10-17 20:44 ` [PATCH 5/6] usb: gadget: m66592-udc: " Uwe Kleine-König 2023-10-17 20:44 ` [PATCH 6/6] usb: gadget: r8a66597-udc: " Uwe Kleine-König
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=20231017204442.1625925-10-u.kleine-koenig@pengutronix.de \ --to=u.kleine-koenig@pengutronix.de \ --cc=arnd@arndb.de \ --cc=gregkh@linuxfoundation.org \ --cc=kernel@pengutronix.de \ --cc=leoyang.li@nxp.com \ --cc=linux-kbuild@vger.kernel.org \ --cc=linux-usb@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.