summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/sec-core.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-04-23 16:13:05 +0200
committerLee Jones <lee.jones@linaro.org>2014-06-03 08:11:21 +0100
commit9549b5ff001a8904372370d10be9a2f05e10eca5 (patch)
treeac06ddeb4bb3c9c7ec8572c86789af1e50d9c95f /drivers/mfd/sec-core.c
parent006cea3aeced7f3d67fe2849da7724683853d87d (diff)
downloadop-kernel-dev-9549b5ff001a8904372370d10be9a2f05e10eca5.zip
op-kernel-dev-9549b5ff001a8904372370d10be9a2f05e10eca5.tar.gz
mfd: sec-core: Remove duplicated device type from sec_pmic_dev
The device type was stored in sec_pmic_dev state container twice: - unsigned long type (initialized from of_device_id or i2c_device_id) - int device_type (initialized as above or from board files when there is no DTS) The 'type' field was never used outside of probe so it can be safely removed. Change also the device_type in sec_pmic_dev and sec_platform_data to unsigned long to avoid any casts. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/sec-core.c')
-rw-r--r--drivers/mfd/sec-core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index d4682c6..09fd256 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -251,6 +251,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev);
const struct regmap_config *regmap;
struct sec_pmic_dev *sec_pmic;
+ unsigned long device_type;
int ret;
sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev),
@@ -262,7 +263,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
sec_pmic->dev = &i2c->dev;
sec_pmic->i2c = i2c;
sec_pmic->irq = i2c->irq;
- sec_pmic->type = sec_i2c_get_driver_data(i2c, id);
+ device_type = sec_i2c_get_driver_data(i2c, id);
if (sec_pmic->dev->of_node) {
pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev);
@@ -270,7 +271,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = PTR_ERR(pdata);
return ret;
}
- pdata->device_type = sec_pmic->type;
+ pdata->device_type = device_type;
}
if (pdata) {
sec_pmic->device_type = pdata->device_type;
OpenPOWER on IntegriCloud