Skip to content

Commit d8c695d

Browse files
Uwe Kleine-Königdlezcano
authored andcommitted
clocksource/drivers/sh_tmu: Mark driver as non-removable
The comment in the remove callback suggests that the driver is not supposed to be unbound. However returning an error code in the remove callback doesn't accomplish that. Instead set the suppress_bind_attrs property (which makes it impossible to unbind the driver via sysfs). The only remaining way to unbind a sh_tmu device would be module unloading, but that doesn't apply here, as the driver cannot be built as a module. Also drop the useless remove callback. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent 225b959 commit d8c695d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/clocksource/sh_tmu.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
632632
return 0;
633633
}
634634

635-
static int sh_tmu_remove(struct platform_device *pdev)
636-
{
637-
return -EBUSY; /* cannot unregister clockevent and clocksource */
638-
}
639-
640635
static const struct platform_device_id sh_tmu_id_table[] = {
641636
{ "sh-tmu", SH_TMU },
642637
{ "sh-tmu-sh3", SH_TMU_SH3 },
@@ -652,10 +647,10 @@ MODULE_DEVICE_TABLE(of, sh_tmu_of_table);
652647

653648
static struct platform_driver sh_tmu_device_driver = {
654649
.probe = sh_tmu_probe,
655-
.remove = sh_tmu_remove,
656650
.driver = {
657651
.name = "sh_tmu",
658652
.of_match_table = of_match_ptr(sh_tmu_of_table),
653+
.suppress_bind_attrs = true,
659654
},
660655
.id_table = sh_tmu_id_table,
661656
};

0 commit comments

Comments
 (0)