forked from LiBwrt/openwrt-6.x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i2c_add_numbered_adapter is the wrong function to use here. It requires setting nr to some value, otherwise it behaves the same as i2c_add_adapter. nr is not set. Signed-off-by: Rosen Penev <[email protected]> Link: openwrt/openwrt#16825 Signed-off-by: Hauke Mehrtens <[email protected]>
- Loading branch information
Showing
1 changed file
with
5 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ Signed-off-by: John Crispin <[email protected]> | |
obj-$(CONFIG_I2C_MESON) += i2c-meson.o | ||
--- /dev/null | ||
+++ b/drivers/i2c/busses/i2c-lantiq.c | ||
@@ -0,0 +1,745 @@ | ||
@@ -0,0 +1,742 @@ | ||
+ | ||
+/* | ||
+ * Lantiq I2C bus adapter | ||
|
@@ -658,7 +658,9 @@ Signed-off-by: John Crispin <[email protected]> | |
+ } | ||
+ | ||
+ init_completion(&priv->cmd_complete); | ||
+ mutex_init(&priv->mutex); | ||
+ ret = devm_mutex_init(&pdev->dev, &priv->mutex); | ||
+ if (ret) | ||
+ return ret; | ||
+ | ||
+ priv->membase = devm_platform_ioremap_resource(pdev, 0); | ||
+ if (IS_ERR(priv->membase)) | ||
|
@@ -719,7 +721,7 @@ Signed-off-by: John Crispin <[email protected]> | |
+ clk_activate(priv->clk_gate); | ||
+ | ||
+ /* add our adapter to the i2c stack */ | ||
+ ret = i2c_add_numbered_adapter(adap); | ||
+ ret = devm_i2c_add_adapter(&pdev->dev, adap); | ||
+ if (ret) { | ||
+ dev_err(&pdev->dev, "can't register I2C adapter\n"); | ||
+ goto out; | ||
|
@@ -737,7 +739,6 @@ Signed-off-by: John Crispin <[email protected]> | |
+ ret = ltq_i2c_hw_init(adap); | ||
+ if (ret) { | ||
+ dev_err(&pdev->dev, "can't configure adapter\n"); | ||
+ i2c_del_adapter(adap); | ||
+ platform_set_drvdata(pdev, NULL); | ||
+ goto out; | ||
+ } else { | ||
|
@@ -762,10 +763,6 @@ Signed-off-by: John Crispin <[email protected]> | |
+ /* power down the core */ | ||
+ clk_deactivate(priv->clk_gate); | ||
+ | ||
+ /* remove driver */ | ||
+ i2c_del_adapter(&priv->adap); | ||
+ kfree(priv); | ||
+ | ||
+ dev_dbg(&pdev->dev, "removed\n"); | ||
+ platform_set_drvdata(pdev, NULL); | ||
+ | ||
|