Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

coresight: remove broken __exit annotations

Functions that are annotated __exit are discarded for built-in drivers,
but the .remove callback in a device driver must still be kept around
to allow bind/unbind operations.

There is now a linker warning for the discarded symbol references:

`tmc_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-tmc-core.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-tmc-core.o
`tpiu_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-tpiu.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-tpiu.o
`etb_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-etb10.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-etb10.o
`static_funnel_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-funnel.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-funnel.o
`dynamic_funnel_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-funnel.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-funnel.o
`static_replicator_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-replicator.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-replicator.o
`dynamic_replicator_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-replicator.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-replicator.o
`catu_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-catu.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-catu.o

Remove all those annotations.

Fixes: 8b0cf82677d1 ("coresight: stm: Allow to build coresight-stm as a module")
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20201208182651.1597945-3-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
45fe7bef 83be0b84

+16 -16
+1 -1
drivers/hwtracing/coresight/coresight-catu.c
··· 567 567 return ret; 568 568 } 569 569 570 - static int __exit catu_remove(struct amba_device *adev) 570 + static int catu_remove(struct amba_device *adev) 571 571 { 572 572 struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev); 573 573
+1 -1
drivers/hwtracing/coresight/coresight-cti-core.c
··· 836 836 if (drvdata->csdev_release) 837 837 drvdata->csdev_release(dev); 838 838 } 839 - static int __exit cti_remove(struct amba_device *adev) 839 + static int cti_remove(struct amba_device *adev) 840 840 { 841 841 struct cti_drvdata *drvdata = dev_get_drvdata(&adev->dev); 842 842
+1 -1
drivers/hwtracing/coresight/coresight-etb10.c
··· 803 803 return ret; 804 804 } 805 805 806 - static int __exit etb_remove(struct amba_device *adev) 806 + static int etb_remove(struct amba_device *adev) 807 807 { 808 808 struct etb_drvdata *drvdata = dev_get_drvdata(&adev->dev); 809 809
+2 -2
drivers/hwtracing/coresight/coresight-etm3x-core.c
··· 902 902 return 0; 903 903 } 904 904 905 - static void __exit clear_etmdrvdata(void *info) 905 + static void clear_etmdrvdata(void *info) 906 906 { 907 907 int cpu = *(int *)info; 908 908 909 909 etmdrvdata[cpu] = NULL; 910 910 } 911 911 912 - static int __exit etm_remove(struct amba_device *adev) 912 + static int etm_remove(struct amba_device *adev) 913 913 { 914 914 struct etm_drvdata *drvdata = dev_get_drvdata(&adev->dev); 915 915
+2 -2
drivers/hwtracing/coresight/coresight-etm4x-core.c
··· 1575 1575 } 1576 1576 }; 1577 1577 1578 - static void __exit clear_etmdrvdata(void *info) 1578 + static void clear_etmdrvdata(void *info) 1579 1579 { 1580 1580 int cpu = *(int *)info; 1581 1581 1582 1582 etmdrvdata[cpu] = NULL; 1583 1583 } 1584 1584 1585 - static int __exit etm4_remove(struct amba_device *adev) 1585 + static int etm4_remove(struct amba_device *adev) 1586 1586 { 1587 1587 struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev); 1588 1588
+3 -3
drivers/hwtracing/coresight/coresight-funnel.c
··· 274 274 return ret; 275 275 } 276 276 277 - static int __exit funnel_remove(struct device *dev) 277 + static int funnel_remove(struct device *dev) 278 278 { 279 279 struct funnel_drvdata *drvdata = dev_get_drvdata(dev); 280 280 ··· 328 328 return ret; 329 329 } 330 330 331 - static int __exit static_funnel_remove(struct platform_device *pdev) 331 + static int static_funnel_remove(struct platform_device *pdev) 332 332 { 333 333 funnel_remove(&pdev->dev); 334 334 pm_runtime_disable(&pdev->dev); ··· 370 370 return funnel_probe(&adev->dev, &adev->res); 371 371 } 372 372 373 - static int __exit dynamic_funnel_remove(struct amba_device *adev) 373 + static int dynamic_funnel_remove(struct amba_device *adev) 374 374 { 375 375 return funnel_remove(&adev->dev); 376 376 }
+3 -3
drivers/hwtracing/coresight/coresight-replicator.c
··· 291 291 return ret; 292 292 } 293 293 294 - static int __exit replicator_remove(struct device *dev) 294 + static int replicator_remove(struct device *dev) 295 295 { 296 296 struct replicator_drvdata *drvdata = dev_get_drvdata(dev); 297 297 ··· 318 318 return ret; 319 319 } 320 320 321 - static int __exit static_replicator_remove(struct platform_device *pdev) 321 + static int static_replicator_remove(struct platform_device *pdev) 322 322 { 323 323 replicator_remove(&pdev->dev); 324 324 pm_runtime_disable(&pdev->dev); ··· 388 388 return replicator_probe(&adev->dev, &adev->res); 389 389 } 390 390 391 - static int __exit dynamic_replicator_remove(struct amba_device *adev) 391 + static int dynamic_replicator_remove(struct amba_device *adev) 392 392 { 393 393 return replicator_remove(&adev->dev); 394 394 }
+1 -1
drivers/hwtracing/coresight/coresight-stm.c
··· 951 951 return ret; 952 952 } 953 953 954 - static int __exit stm_remove(struct amba_device *adev) 954 + static int stm_remove(struct amba_device *adev) 955 955 { 956 956 struct stm_drvdata *drvdata = dev_get_drvdata(&adev->dev); 957 957
+1 -1
drivers/hwtracing/coresight/coresight-tmc-core.c
··· 559 559 spin_unlock_irqrestore(&drvdata->spinlock, flags); 560 560 } 561 561 562 - static int __exit tmc_remove(struct amba_device *adev) 562 + static int tmc_remove(struct amba_device *adev) 563 563 { 564 564 struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev); 565 565
+1 -1
drivers/hwtracing/coresight/coresight-tpiu.c
··· 173 173 return PTR_ERR(drvdata->csdev); 174 174 } 175 175 176 - static int __exit tpiu_remove(struct amba_device *adev) 176 + static int tpiu_remove(struct amba_device *adev) 177 177 { 178 178 struct tpiu_drvdata *drvdata = dev_get_drvdata(&adev->dev); 179 179