Skip to content

Commit 5a87e00

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
ACPI: APEI: EINJ: mark remove callback as __exit
The einj_driver driver is registered using platform_driver_probe(). In this case it cannot get unbound via sysfs and it's ok to put the remove callback into an exit section. To prevent the modpost warning about einj_driver referencing .exit.text, mark the driver struct with __refdata and explain the situation in a comment. This is an improvement over commit a24118a ("ACPI: APEI: EINJ: mark remove callback as non-__exit") which recently addressed the same issue, but picked a less optimal variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Dan Williams <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent fec50db commit 5a87e00

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/acpi/apei/einj-core.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ static int __init einj_probe(struct platform_device *pdev)
851851
return rc;
852852
}
853853

854-
static void einj_remove(struct platform_device *pdev)
854+
static void __exit einj_remove(struct platform_device *pdev)
855855
{
856856
struct apei_exec_context ctx;
857857

@@ -873,8 +873,14 @@ static void einj_remove(struct platform_device *pdev)
873873
}
874874

875875
static struct platform_device *einj_dev;
876-
static struct platform_driver einj_driver = {
877-
.remove_new = einj_remove,
876+
/*
877+
* einj_remove() lives in .exit.text. For drivers registered via
878+
* platform_driver_probe() this is ok because they cannot get unbound at
879+
* runtime. So mark the driver struct with __refdata to prevent modpost
880+
* triggering a section mismatch warning.
881+
*/
882+
static struct platform_driver einj_driver __refdata = {
883+
.remove_new = __exit_p(einj_remove),
878884
.driver = {
879885
.name = "acpi-einj",
880886
},

0 commit comments

Comments
 (0)