mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] driver core: platform: Propagate error from insert_resource()
@ 2019-04-02 15:59 Andy Shevchenko
  2019-04-02 16:02 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2019-04-02 15:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel; +Cc: Andy Shevchenko

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>
---
 drivers/base/platform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dab0a5abc391..f93f192891d1 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -438,9 +438,8 @@ int platform_device_add(struct platform_device *pdev)
 				p = &ioport_resource;
 		}
 
-		if (p && insert_resource(p, r)) {
+		if (p && (ret = insert_resource(p, r))) {
 			dev_err(&pdev->dev, "failed to claim resource %d: %pR\n", i, r);
-			ret = -EBUSY;
 			goto failed;
 		}
 	}
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-03 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02 15:59 [PATCH v1] driver core: platform: Propagate error from insert_resource() Andy Shevchenko
2019-04-02 16:02 ` Rafael J. Wysocki
2019-04-03 11:29   ` Andy Shevchenko
2019-04-03 20:54     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®