diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-gpio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index e62d2d938628..257299a92df3 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c | |||
@@ -184,7 +184,11 @@ static int __devinit i2c_gpio_probe(struct platform_device *pdev) | |||
184 | bit_data->data = pdata; | 184 | bit_data->data = pdata; |
185 | 185 | ||
186 | adap->owner = THIS_MODULE; | 186 | adap->owner = THIS_MODULE; |
187 | snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); | 187 | if (pdev->dev.of_node) |
188 | strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name)); | ||
189 | else | ||
190 | snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); | ||
191 | |||
188 | adap->algo_data = bit_data; | 192 | adap->algo_data = bit_data; |
189 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; | 193 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; |
190 | adap->dev.parent = &pdev->dev; | 194 | adap->dev.parent = &pdev->dev; |