diff options
-rw-r--r-- | drivers/i2c/busses/i2c-nomadik.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 9f1423ac7b3b..063e726dde11 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/amba/bus.h> | 17 | #include <linux/amba/bus.h> |
18 | #include <linux/atomic.h> | ||
19 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
20 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
21 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
@@ -981,8 +980,6 @@ static void nmk_i2c_of_probe(struct device_node *np, | |||
981 | pdata->sm = I2C_FREQ_MODE_FAST; | 980 | pdata->sm = I2C_FREQ_MODE_FAST; |
982 | } | 981 | } |
983 | 982 | ||
984 | static atomic_t adapter_id = ATOMIC_INIT(0); | ||
985 | |||
986 | static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) | 983 | static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) |
987 | { | 984 | { |
988 | int ret = 0; | 985 | int ret = 0; |
@@ -1095,10 +1092,8 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) | |||
1095 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; | 1092 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; |
1096 | adap->algo = &nmk_i2c_algo; | 1093 | adap->algo = &nmk_i2c_algo; |
1097 | adap->timeout = msecs_to_jiffies(pdata->timeout); | 1094 | adap->timeout = msecs_to_jiffies(pdata->timeout); |
1098 | adap->nr = atomic_read(&adapter_id); | ||
1099 | snprintf(adap->name, sizeof(adap->name), | 1095 | snprintf(adap->name, sizeof(adap->name), |
1100 | "Nomadik I2C%d at %pR", adap->nr, &adev->res); | 1096 | "Nomadik I2C at %pR", &adev->res); |
1101 | atomic_inc(&adapter_id); | ||
1102 | 1097 | ||
1103 | /* fetch the controller configuration from machine */ | 1098 | /* fetch the controller configuration from machine */ |
1104 | dev->cfg.clk_freq = pdata->clk_freq; | 1099 | dev->cfg.clk_freq = pdata->clk_freq; |
@@ -1113,7 +1108,7 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) | |||
1113 | "initialize %s on virtual base %p\n", | 1108 | "initialize %s on virtual base %p\n", |
1114 | adap->name, dev->virtbase); | 1109 | adap->name, dev->virtbase); |
1115 | 1110 | ||
1116 | ret = i2c_add_numbered_adapter(adap); | 1111 | ret = i2c_add_adapter(adap); |
1117 | if (ret) { | 1112 | if (ret) { |
1118 | dev_err(&adev->dev, "failed to add adapter\n"); | 1113 | dev_err(&adev->dev, "failed to add adapter\n"); |
1119 | goto err_add_adap; | 1114 | goto err_add_adap; |