aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Sang <[email protected]>2019-08-19 22:48:25 +0200
committerWolfram Sang <[email protected]>2019-08-29 20:38:11 +0200
commit689f535843ac2633b395cfc494446326d03efab6 (patch)
tree03f951a3784d58a0333a48f998c4a0539558b1b9
parenta55aa89aab90fae7c815b0551b07be37db359d76 (diff)
i2c: make i2c_unregister_device() ERR_PTR safe
We are moving towards returning ERR_PTRs when i2c_new_*_device() calls fail. Make sure its counterpart for unregistering handles ERR_PTRs as well. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
-rw-r--r--drivers/i2c/i2c-core-base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index f26ed495d384..9c440fa6a3dd 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -832,7 +832,7 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
*/
void i2c_unregister_device(struct i2c_client *client)
{
- if (!client)
+ if (IS_ERR_OR_NULL(client))
return;
if (client->dev.of_node) {