mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
driver core: platform: Propagate error from insert_resource()
Since insert_resource() might return an error we don't need to shadow its error code and would safely propagate to the user. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
998267900c
commit
25ebcb7dc8
@ -438,10 +438,12 @@ int platform_device_add(struct platform_device *pdev)
|
||||
p = &ioport_resource;
|
||||
}
|
||||
|
||||
if (p && insert_resource(p, r)) {
|
||||
dev_err(&pdev->dev, "failed to claim resource %d: %pR\n", i, r);
|
||||
ret = -EBUSY;
|
||||
goto failed;
|
||||
if (p) {
|
||||
ret = insert_resource(p, r);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to claim resource %d: %pR\n", i, r);
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user