From a4fdf2a3de8cab4dceec80126bd3204b59b84ec5 Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Mon, 15 Oct 2012 15:51:17 +0800 Subject: [PATCH] --- yaml --- r: 347045 b: refs/heads/master c: 58a7371a4dd9d03f77265ee2784781fc39096136 h: refs/heads/master i: 347043: da3117cbd443837dea65e2bcf835356221966774 v: v3 --- [refs] | 2 +- trunk/drivers/i2c/busses/i2c-gpio.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 54bf0a1c64aa..a1dce5c28015 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 970d494c323826d8bb21e8ed1796da15082808ec +refs/heads/master: 58a7371a4dd9d03f77265ee2784781fc39096136 diff --git a/trunk/drivers/i2c/busses/i2c-gpio.c b/trunk/drivers/i2c/busses/i2c-gpio.c index e62d2d938628..257299a92df3 100644 --- a/trunk/drivers/i2c/busses/i2c-gpio.c +++ b/trunk/drivers/i2c/busses/i2c-gpio.c @@ -184,7 +184,11 @@ static int __devinit i2c_gpio_probe(struct platform_device *pdev) bit_data->data = pdata; adap->owner = THIS_MODULE; - snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); + if (pdev->dev.of_node) + strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name)); + else + snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); + adap->algo_data = bit_data; adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; adap->dev.parent = &pdev->dev;