From nobody Fri Dec 19 09:47:50 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16F4A481A8 for ; Sun, 17 Dec 2023 19:31:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rEwrh-0007H4-9b; Sun, 17 Dec 2023 20:31:53 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rEwrg-00GXTq-Sp; Sun, 17 Dec 2023 20:31:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEwrg-004owZ-Jj; Sun, 17 Dec 2023 20:31:52 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Santosh Shilimkar , Krzysztof Kozlowski Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] memory: emif: Drop usage of platform_driver_probe() Date: Sun, 17 Dec 2023 20:31:33 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=4433; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=prMBQ2hUCtXqI31SUwr+YXxg/mNN8P06lT4SD94pU6Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlf0yYc5fPWSiK6VDZRTJfH4m+kxn7+7FcHt0ME LDhaHvRpGeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX9MmAAKCRCPgPtYfRL+ Tm+pB/4lbsjs55REpb7bJZRLG0pPcPE2zk0CeG2sMCR9za6KJzAGC7NtTR2Qvx0FdlBewfLEfxP wgUvxVVYjtGm07zqCLsobijBYxQFu4uSrwRVJCnQqA65frfiI90peK2VDkXWY9red6AwEoT7rNj Me/7erQ111NeAva0+VTE/vv5j3SBVV3a14c1dOz5Za2zgSvwzMt68OVYL//z67mTm2bN4BQCX1n raGrCTfJ1101R1AtDNL0t3SbsZjzH6srwIlybzTr5biu2n98Ed8hsDXOhoC49+v9mdNfxFaD4Sa NVlNF/BtjQyP/jtIlN0bR/Wm0/BELi4UiYXxUuUCcoEVBEii X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org There are considerations to drop platform_driver_probe() as a concept that isn't relevant any more today. It comes with an added complexity that makes many users hold it wrong. (E.g. this driver should have better used __init instead of __init_or_module to mark functions only relevant to .probe() and mark the driver struct with __refdata.) This fixes a W=3D1 build warning: WARNING: modpost: drivers/memory/emif: section mismatch in reference: emif= _driver+0x4 (section: .data) -> emif_remove (section: .exit.text) Signed-off-by: Uwe Kleine-K=C3=B6nig --- drivers/memory/emif.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index 5a3194b9b3bc..84973d7133f4 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -139,7 +139,7 @@ static int emif_mr4_show(struct seq_file *s, void *unus= ed) =20 DEFINE_SHOW_ATTRIBUTE(emif_mr4); =20 -static void __init_or_module emif_debugfs_init(struct emif_data *emif) +static void emif_debugfs_init(struct emif_data *emif) { if (IS_ENABLED(CONFIG_DEBUG_FS)) { emif->debugfs_root =3D debugfs_create_dir(dev_name(emif->dev), NULL); @@ -150,7 +150,7 @@ static void __init_or_module emif_debugfs_init(struct e= mif_data *emif) } } =20 -static void __exit emif_debugfs_exit(struct emif_data *emif) +static void emif_debugfs_exit(struct emif_data *emif) { if (IS_ENABLED(CONFIG_DEBUG_FS)) { debugfs_remove_recursive(emif->debugfs_root); @@ -671,7 +671,7 @@ static void disable_and_clear_all_interrupts(struct emi= f_data *emif) clear_all_interrupts(emif); } =20 -static int __init_or_module setup_interrupts(struct emif_data *emif, u32 i= rq) +static int setup_interrupts(struct emif_data *emif, u32 irq) { u32 interrupts, type; void __iomem *base =3D emif->base; @@ -702,7 +702,7 @@ static int __init_or_module setup_interrupts(struct emi= f_data *emif, u32 irq) =20 } =20 -static void __init_or_module emif_onetime_settings(struct emif_data *emif) +static void emif_onetime_settings(struct emif_data *emif) { u32 pwr_mgmt_ctrl, zq, temp_alert_cfg; void __iomem *base =3D emif->base; @@ -826,7 +826,7 @@ static int is_custom_config_valid(struct emif_custom_co= nfigs *cust_cfgs, return valid; } =20 -static void __init_or_module of_get_custom_configs(struct device_node *np_= emif, +static void of_get_custom_configs(struct device_node *np_emif, struct emif_data *emif) { struct emif_custom_configs *cust_cfgs =3D NULL; @@ -875,7 +875,7 @@ static void __init_or_module of_get_custom_configs(stru= ct device_node *np_emif, emif->plat_data->custom_configs =3D cust_cfgs; } =20 -static void __init_or_module of_get_ddr_info(struct device_node *np_emif, +static void of_get_ddr_info(struct device_node *np_emif, struct device_node *np_ddr, struct ddr_device_info *dev_info) { @@ -909,7 +909,7 @@ static void __init_or_module of_get_ddr_info(struct dev= ice_node *np_emif, dev_info->io_width =3D __fls(io_width) - 1; } =20 -static struct emif_data * __init_or_module of_get_memory_device_details( +static struct emif_data *of_get_memory_device_details( struct device_node *np_emif, struct device *dev) { struct emif_data *emif =3D NULL; @@ -1086,7 +1086,7 @@ static struct emif_data *__init_or_module get_device_= details( return NULL; } =20 -static int __init_or_module emif_probe(struct platform_device *pdev) +static int emif_probe(struct platform_device *pdev) { struct emif_data *emif; int irq, ret; @@ -1141,7 +1141,7 @@ static int __init_or_module emif_probe(struct platfor= m_device *pdev) return -ENODEV; } =20 -static int __exit emif_remove(struct platform_device *pdev) +static int emif_remove(struct platform_device *pdev) { struct emif_data *emif =3D platform_get_drvdata(pdev); =20 @@ -1167,7 +1167,8 @@ MODULE_DEVICE_TABLE(of, emif_of_match); #endif =20 static struct platform_driver emif_driver =3D { - .remove =3D __exit_p(emif_remove), + .probe =3D emif_probe, + .remove =3D emif_remove, .shutdown =3D emif_shutdown, .driver =3D { .name =3D "emif", @@ -1175,7 +1176,7 @@ static struct platform_driver emif_driver =3D { }, }; =20 -module_platform_driver_probe(emif_driver, emif_probe); +module_platform_driver(emif_driver); =20 MODULE_DESCRIPTION("TI EMIF SDRAM Controller Driver"); MODULE_LICENSE("GPL"); --=20 2.42.0