Skip to content

Commit 6d0b239

Browse files
krzklag-linaro
authored andcommitted
mfd: 88pm886: Fix wakeup source leaks on device unbind
Device can be unbound, so driver must also release memory for the wakeup source. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Karel Balej <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 54a425b commit 6d0b239

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mfd/88pm886.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ static int pm886_probe(struct i2c_client *client)
124124
if (err)
125125
return dev_err_probe(dev, err, "Failed to register power off handler\n");
126126

127-
device_init_wakeup(dev, device_property_read_bool(dev, "wakeup-source"));
127+
if (device_property_read_bool(dev, "wakeup-source")) {
128+
err = devm_device_init_wakeup(dev);
129+
if (err)
130+
return dev_err_probe(dev, err, "Failed to init wakeup\n");
131+
}
128132

129133
return 0;
130134
}

0 commit comments

Comments
 (0)