aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-04-23 10:13:05 -0400
committerLee Jones <lee.jones@linaro.org>2014-06-03 03:11:21 -0400
commit9549b5ff001a8904372370d10be9a2f05e10eca5 (patch)
treeac06ddeb4bb3c9c7ec8572c86789af1e50d9c95f
parent006cea3aeced7f3d67fe2849da7724683853d87d (diff)
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>
-rw-r--r--drivers/mfd/sec-core.c5
-rw-r--r--drivers/mfd/sec-irq.c2
-rw-r--r--include/linux/mfd/samsung/core.h3
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index d4682c6cbff5..09fd256abcf6 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,
251 struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); 251 struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev);
252 const struct regmap_config *regmap; 252 const struct regmap_config *regmap;
253 struct sec_pmic_dev *sec_pmic; 253 struct sec_pmic_dev *sec_pmic;
254 unsigned long device_type;
254 int ret; 255 int ret;
255 256
256 sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev), 257 sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev),
@@ -262,7 +263,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
262 sec_pmic->dev = &i2c->dev; 263 sec_pmic->dev = &i2c->dev;
263 sec_pmic->i2c = i2c; 264 sec_pmic->i2c = i2c;
264 sec_pmic->irq = i2c->irq; 265 sec_pmic->irq = i2c->irq;
265 sec_pmic->type = sec_i2c_get_driver_data(i2c, id); 266 device_type = sec_i2c_get_driver_data(i2c, id);
266 267
267 if (sec_pmic->dev->of_node) { 268 if (sec_pmic->dev->of_node) {
268 pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); 269 pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev);
@@ -270,7 +271,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
270 ret = PTR_ERR(pdata); 271 ret = PTR_ERR(pdata);
271 return ret; 272 return ret;
272 } 273 }
273 pdata->device_type = sec_pmic->type; 274 pdata->device_type = device_type;
274 } 275 }
275 if (pdata) { 276 if (pdata) {
276 sec_pmic->device_type = pdata->device_type; 277 sec_pmic->device_type = pdata->device_type;
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 64e7913aadc6..654e2c1dbf7a 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -385,7 +385,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
385 &sec_pmic->irq_data); 385 &sec_pmic->irq_data);
386 break; 386 break;
387 default: 387 default:
388 dev_err(sec_pmic->dev, "Unknown device type %d\n", 388 dev_err(sec_pmic->dev, "Unknown device type %lu\n",
389 sec_pmic->device_type); 389 sec_pmic->device_type);
390 return -EINVAL; 390 return -EINVAL;
391 } 391 }
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 1c66a6462887..47d84242940b 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -48,13 +48,12 @@ struct sec_pmic_dev {
48 struct regmap *regmap_pmic; 48 struct regmap *regmap_pmic;
49 struct i2c_client *i2c; 49 struct i2c_client *i2c;
50 50
51 int device_type; 51 unsigned long device_type;
52 int irq_base; 52 int irq_base;
53 int irq; 53 int irq;
54 struct regmap_irq_chip_data *irq_data; 54 struct regmap_irq_chip_data *irq_data;
55 55
56 int ono; 56 int ono;
57 unsigned long type;
58 bool wakeup; 57 bool wakeup;
59 bool wtsr_smpl; 58 bool wtsr_smpl;
60}; 59};