From: Yang Yingliang <yangyingliang@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>, <rafael@kernel.org>
Subject: Re: [PATCH -next] driver core: switch to use dev_err_probe()
Date: Mon, 22 Aug 2022 10:10:22 +0800 [thread overview]
Message-ID: <1d4d1ef7-7386-cf8f-0a5a-04690ec27ed6@huawei.com> (raw)
In-Reply-To: <Yv9a9+iREzQWYecQ@kroah.com>
Hi,
On 2022/8/19 17:42, Greg KH wrote:
> On Fri, Aug 19, 2022 at 05:46:56PM +0800, Yang Yingliang wrote:
>> Use dev_err_probe() to simplify code and print error code.
>>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>> drivers/base/core.c | 8 +++-----
>> 1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/base/core.c b/drivers/base/core.c
>> index 753e7cca0f40..e51a09f9d0ec 100644
>> --- a/drivers/base/core.c
>> +++ b/drivers/base/core.c
>> @@ -2507,11 +2507,9 @@ static ssize_t uevent_store(struct device *dev, struct device_attribute *attr,
>> int rc;
>>
>> rc = kobject_synth_uevent(&dev->kobj, buf, count);
>> -
>> - if (rc) {
>> - dev_err(dev, "uevent: failed to send synthetic uevent\n");
>> - return rc;
>> - }
>> + if (rc)
>> + return dev_err_probe(dev, rc,
>> + "uevent: failed to send synthetic uevent\n");
> I do not understand this at all, this is not on the probe path at all,
> so why is this function needed?
>
> Have you tested this? What was the resulting output before and after
> this change?
Yes, after this change, the error code will be print.
>
> thanks,
>
> greg k-h
> .
next prev parent reply other threads:[~2022-08-22 2:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 9:46 Yang Yingliang
2022-08-19 9:42 ` Greg KH
2022-08-22 2:10 ` Yang Yingliang [this message]
2022-08-22 6:09 ` Greg KH
2022-08-22 6:35 ` Yang Yingliang
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=1d4d1ef7-7386-cf8f-0a5a-04690ec27ed6@huawei.com \
--to=yangyingliang@huawei.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
all inboxes | Powered by JetHome®