diff options
author | Cai Huoqing <caihuoqing@baidu.com> | 2021-11-05 15:15:09 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-27 10:56:45 +0100 |
commit | 2043727c2882928a10161ddee52b196b7db402fd (patch) | |
tree | 72296844bbf51903fffd50920e597175d0216326 /drivers/base/platform.c | |
parent | a6914afcdf0e3fb853fce0e0c04710be7427b62f (diff) | |
download | linux-2043727c2882928a10161ddee52b196b7db402fd.tar.gz linux-2043727c2882928a10161ddee52b196b7db402fd.tar.bz2 linux-2043727c2882928a10161ddee52b196b7db402fd.zip |
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.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20211105071509.969-1-caihuoqing@baidu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 598acf93a360..7109351366c8 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -258,8 +258,9 @@ int platform_get_irq(struct platform_device *dev, 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); + if (ret < 0) + return dev_err_probe(&dev->dev, ret, + "IRQ index %u not found\n", num); return ret; } |