[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220819094656.1945653-1-yangyingliang@huawei.com>
Date: Fri, 19 Aug 2022 17:46:56 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>, <rafael@...nel.org>
CC: <gregkh@...uxfoundation.org>
Subject: [PATCH -next] driver core: switch to use dev_err_probe()
Use dev_err_probe() to simplify code and print error code.
Signed-off-by: Yang Yingliang <yangyingliang@...wei.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");
return count;
}
--
2.25.1
Powered by blists - more mailing lists