diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-11-26 13:24:22 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-27 12:05:36 +0300 |
commit | 3b1ad360acad6052c2568f891bb3d0f3f057016f (patch) | |
tree | de4291619d8337d97483536676c2938931948c97 /drivers/pps/clients/pps_parport.c | |
parent | eb30abeedee76c04bdf41c6d88545472c11a5632 (diff) | |
download | linux-3b1ad360acad6052c2568f891bb3d0f3f057016f.tar.xz |
pps: using ERR_PTR instead of NULL while pps_register_source fails
pps_register_source() has keeps error codes in a local variable,
but it does not make use of the code. This patch let it return
the errcode in case of failure.
Suggested-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pps/clients/pps_parport.c')
-rw-r--r-- | drivers/pps/clients/pps_parport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 4db824f88d00..7226e39aae83 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c @@ -179,7 +179,7 @@ static void parport_attach(struct parport *port) device->pps = pps_register_source(&info, PPS_CAPTUREBOTH | PPS_OFFSETASSERT | PPS_OFFSETCLEAR); - if (device->pps == NULL) { + if (IS_ERR(device->pps)) { pr_err("couldn't register PPS source\n"); goto err_release_dev; } |