public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/4] driver core: platform: Drop redundant check in platform_device_add()
@ 2023-10-03 14:21 Andy Shevchenko
  2023-10-03 14:21 ` [PATCH v1 2/4] driver core: platform: Refactor error path in a couple places Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2023-10-03 14:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Andy Shevchenko

Starting from the commit 37c12e7497b6 ("[DRIVER MODEL] Improved
dynamically allocated platform_device interface") the pdev expects
to be allocated beforehand or guaranteed to be non-NULL.

Hence the leftover check is now redundant (as we have no combined
calls like platform_device_add(platform_device_alloc(...)) in the
entire kernel source code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/platform.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 76bfcba25003..d81f05c4fccd 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -658,9 +658,6 @@ int platform_device_add(struct platform_device *pdev)
 	u32 i;
 	int ret;
 
-	if (!pdev)
-		return -EINVAL;
-
 	if (!pdev->dev.parent)
 		pdev->dev.parent = &platform_bus;
 
-- 
2.40.0.1.gaa8946217a0b


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

end of thread, other threads:[~2023-10-03 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-03 14:21 [PATCH v1 1/4] driver core: platform: Drop redundant check in platform_device_add() Andy Shevchenko
2023-10-03 14:21 ` [PATCH v1 2/4] driver core: platform: Refactor error path in a couple places Andy Shevchenko
2023-10-03 14:21 ` [PATCH v1 3/4] driver core: platform: Use temporary variable in platform_device_add() Andy Shevchenko
2023-10-03 14:21 ` [PATCH v1 4/4] driver core: platform: Unify the firmware node type check Andy Shevchenko

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