Commit c878a52d authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki
Browse files

cpuidle: Check if device is already registered

Make __cpuidle_register_device() check whether or not the device has
been registered already and return -EBUSY immediately if that's the

[rjw: Changelog]
Signed-off-by: default avatarDaniel Lezcano <>
Signed-off-by: default avatarRafael J. Wysocki <>
parent 5df0aa73
......@@ -400,13 +400,16 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
int cpuidle_register_device(struct cpuidle_device *dev)
int ret;
int ret = -EBUSY;
if (!dev)
return -EINVAL;
if (dev->registered)
goto out_unlock;
ret = __cpuidle_device_init(dev);
if (ret)
goto out_unlock;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment