diff options
-rw-r--r-- | drivers/i2c/busses/i2c-pca-platform.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index 395eca0cbb1f..daccef6865e8 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
@@ -184,7 +184,6 @@ static int i2c_pca_pf_probe(struct platform_device *pdev) | |||
184 | if (ret == 0) { | 184 | if (ret == 0) { |
185 | i2c->gpio = gpio_to_desc(platform_data->gpio); | 185 | i2c->gpio = gpio_to_desc(platform_data->gpio); |
186 | gpiod_direction_output(i2c->gpio, 0); | 186 | gpiod_direction_output(i2c->gpio, 0); |
187 | i2c->algo_data.reset_chip = i2c_pca_pf_resetchip; | ||
188 | } else { | 187 | } else { |
189 | dev_warn(&pdev->dev, "Registering gpio failed!\n"); | 188 | dev_warn(&pdev->dev, "Registering gpio failed!\n"); |
190 | i2c->gpio = NULL; | 189 | i2c->gpio = NULL; |
@@ -205,7 +204,10 @@ static int i2c_pca_pf_probe(struct platform_device *pdev) | |||
205 | 204 | ||
206 | i2c->algo_data.data = i2c; | 205 | i2c->algo_data.data = i2c; |
207 | i2c->algo_data.wait_for_completion = i2c_pca_pf_waitforcompletion; | 206 | i2c->algo_data.wait_for_completion = i2c_pca_pf_waitforcompletion; |
208 | i2c->algo_data.reset_chip = i2c_pca_pf_dummyreset; | 207 | if (i2c->gpio) |
208 | i2c->algo_data.reset_chip = i2c_pca_pf_resetchip; | ||
209 | else | ||
210 | i2c->algo_data.reset_chip = i2c_pca_pf_dummyreset; | ||
209 | 211 | ||
210 | switch (res->flags & IORESOURCE_MEM_TYPE_MASK) { | 212 | switch (res->flags & IORESOURCE_MEM_TYPE_MASK) { |
211 | case IORESOURCE_MEM_32BIT: | 213 | case IORESOURCE_MEM_32BIT: |