summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-core-base.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2017-11-02 01:49:36 +0300
committerWolfram Sang <wsa@the-dreams.de>2017-11-02 01:49:36 +0300
commitf6d2953643164525b22edcc09720c2cbf2e52d21 (patch)
treed4bd80a15eab6c4017215096e19bce6fb163e94f /drivers/i2c/i2c-core-base.c
parent4ee045f4e9b73c4635ceedbb1ee40e0b3ecbdbcc (diff)
parent4cf419a2b4c2e5bb0583e32e5fe079995c987c0f (diff)
downloadlinux-f6d2953643164525b22edcc09720c2cbf2e52d21.tar.xz
Merge branch 'i2c/sbs-manager' into i2c/for-4.15
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r--drivers/i2c/i2c-core-base.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index db6558e5f657..7b08f3446bfc 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -29,6 +29,7 @@
#include <linux/errno.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
+#include <linux/i2c-smbus.h>
#include <linux/idr.h>
#include <linux/init.h>
#include <linux/irqflags.h>
@@ -1269,6 +1270,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
goto out_list;
}
+ res = of_i2c_setup_smbus_alert(adap);
+ if (res)
+ goto out_reg;
+
dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name);
pm_runtime_no_callbacks(&adap->dev);
@@ -1300,6 +1305,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
return 0;
+out_reg:
+ init_completion(&adap->dev_released);
+ device_unregister(&adap->dev);
+ wait_for_completion(&adap->dev_released);
out_list:
mutex_lock(&core_lock);
idr_remove(&i2c_adapter_idr, adap->nr);