Skip to content

Commit

Permalink
coresight: remove broken __exit annotations
Browse files Browse the repository at this point in the history
[ Upstream commit 45fe7be ]

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: 8b0cf82 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
arndb authored and gregkh committed Dec 30, 2020
1 parent 64ffbfb commit 939b32e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-catu.c
Expand Up @@ -567,7 +567,7 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id)
return ret;
}

static int __exit catu_remove(struct amba_device *adev)
static int catu_remove(struct amba_device *adev)
{
struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-cti-core.c
Expand Up @@ -836,7 +836,7 @@ static void cti_device_release(struct device *dev)
if (drvdata->csdev_release)
drvdata->csdev_release(dev);
}
static int __exit cti_remove(struct amba_device *adev)
static int cti_remove(struct amba_device *adev)
{
struct cti_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-etb10.c
Expand Up @@ -803,7 +803,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
return ret;
}

static int __exit etb_remove(struct amba_device *adev)
static int etb_remove(struct amba_device *adev)
{
struct etb_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
4 changes: 2 additions & 2 deletions drivers/hwtracing/coresight/coresight-etm3x-core.c
Expand Up @@ -902,14 +902,14 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
return 0;
}

static void __exit clear_etmdrvdata(void *info)
static void clear_etmdrvdata(void *info)
{
int cpu = *(int *)info;

etmdrvdata[cpu] = NULL;
}

static int __exit etm_remove(struct amba_device *adev)
static int etm_remove(struct amba_device *adev)
{
struct etm_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
4 changes: 2 additions & 2 deletions drivers/hwtracing/coresight/coresight-etm4x-core.c
Expand Up @@ -1570,14 +1570,14 @@ static struct amba_cs_uci_id uci_id_etm4[] = {
}
};

static void __exit clear_etmdrvdata(void *info)
static void clear_etmdrvdata(void *info)
{
int cpu = *(int *)info;

etmdrvdata[cpu] = NULL;
}

static int __exit etm4_remove(struct amba_device *adev)
static int etm4_remove(struct amba_device *adev)
{
struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
6 changes: 3 additions & 3 deletions drivers/hwtracing/coresight/coresight-funnel.c
Expand Up @@ -274,7 +274,7 @@ static int funnel_probe(struct device *dev, struct resource *res)
return ret;
}

static int __exit funnel_remove(struct device *dev)
static int funnel_remove(struct device *dev)
{
struct funnel_drvdata *drvdata = dev_get_drvdata(dev);

Expand Down Expand Up @@ -328,7 +328,7 @@ static int static_funnel_probe(struct platform_device *pdev)
return ret;
}

static int __exit static_funnel_remove(struct platform_device *pdev)
static int static_funnel_remove(struct platform_device *pdev)
{
funnel_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
Expand Down Expand Up @@ -370,7 +370,7 @@ static int dynamic_funnel_probe(struct amba_device *adev,
return funnel_probe(&adev->dev, &adev->res);
}

static int __exit dynamic_funnel_remove(struct amba_device *adev)
static int dynamic_funnel_remove(struct amba_device *adev)
{
return funnel_remove(&adev->dev);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/hwtracing/coresight/coresight-replicator.c
Expand Up @@ -291,7 +291,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
return ret;
}

static int __exit replicator_remove(struct device *dev)
static int replicator_remove(struct device *dev)
{
struct replicator_drvdata *drvdata = dev_get_drvdata(dev);

Expand All @@ -318,7 +318,7 @@ static int static_replicator_probe(struct platform_device *pdev)
return ret;
}

static int __exit static_replicator_remove(struct platform_device *pdev)
static int static_replicator_remove(struct platform_device *pdev)
{
replicator_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
Expand Down Expand Up @@ -388,7 +388,7 @@ static int dynamic_replicator_probe(struct amba_device *adev,
return replicator_probe(&adev->dev, &adev->res);
}

static int __exit dynamic_replicator_remove(struct amba_device *adev)
static int dynamic_replicator_remove(struct amba_device *adev)
{
return replicator_remove(&adev->dev);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-stm.c
Expand Up @@ -951,7 +951,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
return ret;
}

static int __exit stm_remove(struct amba_device *adev)
static int stm_remove(struct amba_device *adev)
{
struct stm_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-tmc-core.c
Expand Up @@ -559,7 +559,7 @@ static void tmc_shutdown(struct amba_device *adev)
spin_unlock_irqrestore(&drvdata->spinlock, flags);
}

static int __exit tmc_remove(struct amba_device *adev)
static int tmc_remove(struct amba_device *adev)
{
struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-tpiu.c
Expand Up @@ -173,7 +173,7 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id)
return PTR_ERR(drvdata->csdev);
}

static int __exit tpiu_remove(struct amba_device *adev)
static int tpiu_remove(struct amba_device *adev)
{
struct tpiu_drvdata *drvdata = dev_get_drvdata(&adev->dev);

Expand Down

0 comments on commit 939b32e

Please sign in to comment.