From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/4] driver core: platform: Drop redundant check in platform_device_add()
Date: Tue, 3 Oct 2023 17:21:19 +0300 [thread overview]
Message-ID: <20231003142122.3072824-1-andriy.shevchenko@linux.intel.com> (raw)
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
next reply other threads:[~2023-10-03 14:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 14:21 Andy Shevchenko [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231003142122.3072824-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox