mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
staging: kpc2000: kpc_i2c: fail probe if unable to map I/O space
The kpc2000 driver does not verify whether or not mapping the I/O space succeeded during probe time. Make the driver verify that the mapping operation was successful before potentially using that area in the future. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4ff740315a
commit
e621c8a108
1 changed files with 2 additions and 0 deletions
|
|
@ -591,6 +591,8 @@ static int pi2c_probe(struct platform_device *pldev)
|
|||
return -ENXIO;
|
||||
|
||||
priv->smba = (unsigned long)ioremap_nocache(res->start, resource_size(res));
|
||||
if (!priv->smba)
|
||||
return -ENOMEM;
|
||||
|
||||
platform_set_drvdata(pldev, priv);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue