From: 李哲 <sensor1010@163.com>
To: gregkh@linuxfoundation.org, rafael@kernel.org
Cc: linux-kernel@vger.kernel.org, 李哲 <sensor1010@163.com>
Subject: [PATCH] driver:core: NO need to determine whether the driver is asynchronous
Date: Sat, 13 Jul 2024 22:05:07 -0700 [thread overview]
Message-ID: <20240714050507.2505-1-sensor1010@163.com> (raw)
When rescanning the device, there is no need to determine
whether the driver is asynchronous.
Signed-off-by: 李哲 <sensor1010@163.com>
---
drivers/base/dd.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 47351d98f6e1..41fd4b1b4779 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -915,7 +915,7 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
{
struct device_attach_data *data = _data;
struct device *dev = data->dev;
- bool async_allowed;
+ bool async_allowed = false;
int ret;
ret = driver_match_device(drv, dev);
@@ -936,12 +936,14 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
return ret;
} /* ret > 0 means positive match */
- async_allowed = driver_allows_async_probing(drv);
+ if (data->check_async) {
+ async_allowed = driver_allows_async_probing(drv);
- if (async_allowed)
- data->have_async = true;
+ if (async_allowed)
+ data->have_async = true;
+ }
- if (data->check_async && async_allowed != data->want_async)
+ if (async_allowed != data->want_async)
return 0;
/*
--
2.17.1
next reply other threads:[~2024-07-14 5:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-14 5:05 李哲 [this message]
2024-07-31 12:49 ` [PATCH] driver:core: NO need to determine whether the driver is asynchronous Greg KH
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=20240714050507.2505-1-sensor1010@163.com \
--to=sensor1010@163.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