mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
reset: ma35d1: Use devm_register_sys_off_handler()
Function register_restart_handler() is deprecated. Using this new API removes our need to keep and manage a struct notifier_block and to later unregister the handler. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
committed by
Philipp Zabel
parent
09f166128a
commit
42d03696a0
@@ -19,7 +19,6 @@
|
||||
|
||||
struct ma35d1_reset_data {
|
||||
struct reset_controller_dev rcdev;
|
||||
struct notifier_block restart_handler;
|
||||
void __iomem *base;
|
||||
/* protect registers against concurrent read-modify-write */
|
||||
spinlock_t lock;
|
||||
@@ -125,10 +124,9 @@ static const struct {
|
||||
[MA35D1_RESET_SSPCC] = {0x2C, 31}
|
||||
};
|
||||
|
||||
static int ma35d1_restart_handler(struct notifier_block *this, unsigned long mode, void *cmd)
|
||||
static int ma35d1_restart_handler(struct sys_off_data *sys_off_data)
|
||||
{
|
||||
struct ma35d1_reset_data *data =
|
||||
container_of(this, struct ma35d1_reset_data, restart_handler);
|
||||
struct ma35d1_reset_data *data = sys_off_data->cb_data;
|
||||
u32 id = MA35D1_RESET_CHIP;
|
||||
|
||||
writel_relaxed(BIT(ma35d1_reset_map[id].bit),
|
||||
@@ -213,11 +211,10 @@ static int ma35d1_reset_probe(struct platform_device *pdev)
|
||||
reset_data->rcdev.nr_resets = MA35D1_RESET_COUNT;
|
||||
reset_data->rcdev.ops = &ma35d1_reset_ops;
|
||||
reset_data->rcdev.of_node = dev->of_node;
|
||||
reset_data->restart_handler.notifier_call = ma35d1_restart_handler;
|
||||
reset_data->restart_handler.priority = 192;
|
||||
spin_lock_init(&reset_data->lock);
|
||||
|
||||
err = register_restart_handler(&reset_data->restart_handler);
|
||||
err = devm_register_sys_off_handler(dev, SYS_OFF_MODE_RESTART, 192,
|
||||
ma35d1_restart_handler, reset_data);
|
||||
if (err)
|
||||
dev_warn(&pdev->dev, "failed to register restart handler\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user