Message ID | 1360933026-30325-7-git-send-email-lee.jones@linaro.org |
---|---|
State | New |
Headers | show |
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 7c20728..678afd0 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1095,9 +1095,15 @@ static ssize_t show_chip_id(struct device *dev, struct device_attribute *attr, char *buf) { struct ab8500 *ab8500; + int chip_id = -EINVAL; ab8500 = dev_get_drvdata(dev); - return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL); + if(ab8500) { + chip_id = ab8500->chip_id; + if((is_ab8505(ab8500) || is_ab9540(ab8500)) && ab8500->version != 0xFF) + chip_id = (ab8500->version << 8) | chip_id; + } + return sprintf(buf, "%#x\n", chip_id); } /*