Commit f0b203bf authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Krzysztof Kozlowski

memory: emif: Drop usage of platform_driver_probe()

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=1 build warning:

	WARNING: modpost: drivers/memory/emif: section mismatch in reference: emif_driver+0x4 (section: .data) -> emif_remove (section: .exit.text)
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240123170846.1362597-2-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
parent d10e03cf
...@@ -139,7 +139,7 @@ static int emif_mr4_show(struct seq_file *s, void *unused) ...@@ -139,7 +139,7 @@ static int emif_mr4_show(struct seq_file *s, void *unused)
DEFINE_SHOW_ATTRIBUTE(emif_mr4); DEFINE_SHOW_ATTRIBUTE(emif_mr4);
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)) { if (IS_ENABLED(CONFIG_DEBUG_FS)) {
emif->debugfs_root = debugfs_create_dir(dev_name(emif->dev), NULL); emif->debugfs_root = debugfs_create_dir(dev_name(emif->dev), NULL);
...@@ -150,7 +150,7 @@ static void __init_or_module emif_debugfs_init(struct emif_data *emif) ...@@ -150,7 +150,7 @@ static void __init_or_module emif_debugfs_init(struct emif_data *emif)
} }
} }
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)) { if (IS_ENABLED(CONFIG_DEBUG_FS)) {
debugfs_remove_recursive(emif->debugfs_root); debugfs_remove_recursive(emif->debugfs_root);
...@@ -671,7 +671,7 @@ static void disable_and_clear_all_interrupts(struct emif_data *emif) ...@@ -671,7 +671,7 @@ static void disable_and_clear_all_interrupts(struct emif_data *emif)
clear_all_interrupts(emif); clear_all_interrupts(emif);
} }
static int __init_or_module setup_interrupts(struct emif_data *emif, u32 irq) static int setup_interrupts(struct emif_data *emif, u32 irq)
{ {
u32 interrupts, type; u32 interrupts, type;
void __iomem *base = emif->base; void __iomem *base = emif->base;
...@@ -702,7 +702,7 @@ static int __init_or_module setup_interrupts(struct emif_data *emif, u32 irq) ...@@ -702,7 +702,7 @@ static int __init_or_module setup_interrupts(struct emif_data *emif, u32 irq)
} }
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; u32 pwr_mgmt_ctrl, zq, temp_alert_cfg;
void __iomem *base = emif->base; void __iomem *base = emif->base;
...@@ -826,7 +826,7 @@ static int is_custom_config_valid(struct emif_custom_configs *cust_cfgs, ...@@ -826,7 +826,7 @@ static int is_custom_config_valid(struct emif_custom_configs *cust_cfgs,
return valid; return valid;
} }
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_data *emif)
{ {
struct emif_custom_configs *cust_cfgs = NULL; struct emif_custom_configs *cust_cfgs = NULL;
...@@ -875,7 +875,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif, ...@@ -875,7 +875,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
emif->plat_data->custom_configs = cust_cfgs; emif->plat_data->custom_configs = cust_cfgs;
} }
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 device_node *np_ddr,
struct ddr_device_info *dev_info) struct ddr_device_info *dev_info)
{ {
...@@ -909,7 +909,7 @@ static void __init_or_module of_get_ddr_info(struct device_node *np_emif, ...@@ -909,7 +909,7 @@ static void __init_or_module of_get_ddr_info(struct device_node *np_emif,
dev_info->io_width = __fls(io_width) - 1; dev_info->io_width = __fls(io_width) - 1;
} }
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 device_node *np_emif, struct device *dev)
{ {
struct emif_data *emif = NULL; struct emif_data *emif = NULL;
...@@ -982,7 +982,7 @@ static struct emif_data * __init_or_module of_get_memory_device_details( ...@@ -982,7 +982,7 @@ static struct emif_data * __init_or_module of_get_memory_device_details(
return emif; return emif;
} }
static struct emif_data *__init_or_module get_device_details( static struct emif_data *get_device_details(
struct platform_device *pdev) struct platform_device *pdev)
{ {
u32 size; u32 size;
...@@ -1086,7 +1086,7 @@ static struct emif_data *__init_or_module get_device_details( ...@@ -1086,7 +1086,7 @@ static struct emif_data *__init_or_module get_device_details(
return NULL; return NULL;
} }
static int __init_or_module emif_probe(struct platform_device *pdev) static int emif_probe(struct platform_device *pdev)
{ {
struct emif_data *emif; struct emif_data *emif;
int irq, ret; int irq, ret;
...@@ -1141,7 +1141,7 @@ static int __init_or_module emif_probe(struct platform_device *pdev) ...@@ -1141,7 +1141,7 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
static void __exit emif_remove(struct platform_device *pdev) static void emif_remove(struct platform_device *pdev)
{ {
struct emif_data *emif = platform_get_drvdata(pdev); struct emif_data *emif = platform_get_drvdata(pdev);
...@@ -1165,7 +1165,8 @@ MODULE_DEVICE_TABLE(of, emif_of_match); ...@@ -1165,7 +1165,8 @@ MODULE_DEVICE_TABLE(of, emif_of_match);
#endif #endif
static struct platform_driver emif_driver = { static struct platform_driver emif_driver = {
.remove_new = __exit_p(emif_remove), .probe = emif_probe,
.remove_new = emif_remove,
.shutdown = emif_shutdown, .shutdown = emif_shutdown,
.driver = { .driver = {
.name = "emif", .name = "emif",
...@@ -1173,7 +1174,7 @@ static struct platform_driver emif_driver = { ...@@ -1173,7 +1174,7 @@ static struct platform_driver emif_driver = {
}, },
}; };
module_platform_driver_probe(emif_driver, emif_probe); module_platform_driver(emif_driver);
MODULE_DESCRIPTION("TI EMIF SDRAM Controller Driver"); MODULE_DESCRIPTION("TI EMIF SDRAM Controller Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment