Skip to content

Commit 9ec8002

Browse files
committed
Merge tag 'litex-6.13-rc1' of https://github.com/litex-hub/linux into soc/drivers
LiteX updates for next Remaining LiteX updates from 2024, reviewed and successfully tested against v6.13-rc1. Signed-off-by: Gabriel Somlo <gsomlo@gmail.com> * tag 'litex-6.13-rc1' of https://github.com/litex-hub/linux: drivers/soc/litex: Use devm_register_restart_handler() Link: https://lore.kernel.org/r/Z41PgCffqPUTyxkE@errol.ini.cmu.edu Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents f51df26 + c734586 commit 9ec8002

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

drivers/soc/litex/litex_soc_ctrl.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,11 @@ static int litex_check_csr_access(void __iomem *reg_addr)
6969

7070
struct litex_soc_ctrl_device {
7171
void __iomem *base;
72-
struct notifier_block reset_nb;
7372
};
7473

75-
static int litex_reset_handler(struct notifier_block *this, unsigned long mode,
76-
void *cmd)
74+
static int litex_reset_handler(struct sys_off_data *data)
7775
{
78-
struct litex_soc_ctrl_device *soc_ctrl_dev =
79-
container_of(this, struct litex_soc_ctrl_device, reset_nb);
76+
struct litex_soc_ctrl_device *soc_ctrl_dev = data->cb_data;
8077

8178
litex_write32(soc_ctrl_dev->base + RESET_REG_OFF, RESET_REG_VALUE);
8279
return NOTIFY_DONE;
@@ -105,11 +102,9 @@ static int litex_soc_ctrl_probe(struct platform_device *pdev)
105102
if (error)
106103
return error;
107104

108-
platform_set_drvdata(pdev, soc_ctrl_dev);
109-
110-
soc_ctrl_dev->reset_nb.notifier_call = litex_reset_handler;
111-
soc_ctrl_dev->reset_nb.priority = 128;
112-
error = register_restart_handler(&soc_ctrl_dev->reset_nb);
105+
error = devm_register_restart_handler(&pdev->dev,
106+
litex_reset_handler,
107+
soc_ctrl_dev);
113108
if (error) {
114109
dev_warn(&pdev->dev, "cannot register restart handler: %d\n",
115110
error);
@@ -118,20 +113,12 @@ static int litex_soc_ctrl_probe(struct platform_device *pdev)
118113
return 0;
119114
}
120115

121-
static void litex_soc_ctrl_remove(struct platform_device *pdev)
122-
{
123-
struct litex_soc_ctrl_device *soc_ctrl_dev = platform_get_drvdata(pdev);
124-
125-
unregister_restart_handler(&soc_ctrl_dev->reset_nb);
126-
}
127-
128116
static struct platform_driver litex_soc_ctrl_driver = {
129117
.driver = {
130118
.name = "litex-soc-controller",
131119
.of_match_table = litex_soc_ctrl_of_match,
132120
},
133121
.probe = litex_soc_ctrl_probe,
134-
.remove = litex_soc_ctrl_remove,
135122
};
136123

137124
module_platform_driver(litex_soc_ctrl_driver);

0 commit comments

Comments
 (0)