lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 5 Nov 2021 11:09:59 +0800
From:   Cai Huoqing <caihuoqing@...du.com>
To:     <caihuoqing@...du.com>
CC:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] driver core: platform: Make use of the helper function dev_err_probe()

When possible using dev_err_probe() helps to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
BTW rename 'dev' to 'pdev'.

Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
---
 drivers/base/platform.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 598acf93a360..5befd3258677 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -253,13 +253,14 @@ EXPORT_SYMBOL_GPL(platform_get_irq_optional);
  *
  * Return: non-zero IRQ number on success, negative error number on failure.
  */
-int platform_get_irq(struct platform_device *dev, unsigned int num)
+int platform_get_irq(struct platform_device *pdev, unsigned int num)
 {
 	int ret;
 
-	ret = platform_get_irq_optional(dev, num);
-	if (ret < 0 && ret != -EPROBE_DEFER)
-		dev_err(&dev->dev, "IRQ index %u not found\n", num);
+	ret = platform_get_irq_optional(pdev, num);
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret,
+				     "IRQ index %u not found\n", num);
 
 	return ret;
 }
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ