[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231003142122.3072824-1-andriy.shevchenko@linux.intel.com>
Date: Tue, 3 Oct 2023 17:21:19 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/4] driver core: platform: Drop redundant check in platform_device_add()
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@...ux.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
Powered by blists - more mailing lists