* [PATCH] driver:core: NO need to determine whether the driver is asynchronous
@ 2024-07-14 5:05 李哲
2024-07-31 12:49 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: 李哲 @ 2024-07-14 5:05 UTC (permalink / raw)
To: gregkh, rafael; +Cc: linux-kernel, 李哲
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] driver:core: NO need to determine whether the driver is asynchronous
2024-07-14 5:05 [PATCH] driver:core: NO need to determine whether the driver is asynchronous 李哲
@ 2024-07-31 12:49 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2024-07-31 12:49 UTC (permalink / raw)
To: 李哲; +Cc: rafael, linux-kernel
On Sat, Jul 13, 2024 at 10:05:07PM -0700, 李哲 wrote:
> 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;
>
I'm sorry, but I don't see what this is making simpler or cleaner. It's
increasing the lines of code, and just moving things around?
What issue is this fixing? What logic is changing? Why is this needed?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-31 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-14 5:05 [PATCH] driver:core: NO need to determine whether the driver is asynchronous 李哲
2024-07-31 12:49 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox