Commit 9549b5ff authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Lee Jones

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: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 006cea3a
...@@ -251,6 +251,7 @@ static int sec_pmic_probe(struct i2c_client *i2c, ...@@ -251,6 +251,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev);
const struct regmap_config *regmap; const struct regmap_config *regmap;
struct sec_pmic_dev *sec_pmic; struct sec_pmic_dev *sec_pmic;
unsigned long device_type;
int ret; int ret;
sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev), 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,7 +263,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
sec_pmic->dev = &i2c->dev; sec_pmic->dev = &i2c->dev;
sec_pmic->i2c = i2c; sec_pmic->i2c = i2c;
sec_pmic->irq = i2c->irq; 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) { if (sec_pmic->dev->of_node) {
pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev);
...@@ -270,7 +271,7 @@ static int sec_pmic_probe(struct i2c_client *i2c, ...@@ -270,7 +271,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = PTR_ERR(pdata); ret = PTR_ERR(pdata);
return ret; return ret;
} }
pdata->device_type = sec_pmic->type; pdata->device_type = device_type;
} }
if (pdata) { if (pdata) {
sec_pmic->device_type = pdata->device_type; sec_pmic->device_type = pdata->device_type;
......
...@@ -385,7 +385,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) ...@@ -385,7 +385,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
&sec_pmic->irq_data); &sec_pmic->irq_data);
break; break;
default: default:
dev_err(sec_pmic->dev, "Unknown device type %d\n", dev_err(sec_pmic->dev, "Unknown device type %lu\n",
sec_pmic->device_type); sec_pmic->device_type);
return -EINVAL; return -EINVAL;
} }
......
...@@ -48,13 +48,12 @@ struct sec_pmic_dev { ...@@ -48,13 +48,12 @@ struct sec_pmic_dev {
struct regmap *regmap_pmic; struct regmap *regmap_pmic;
struct i2c_client *i2c; struct i2c_client *i2c;
int device_type; unsigned long device_type;
int irq_base; int irq_base;
int irq; int irq;
struct regmap_irq_chip_data *irq_data; struct regmap_irq_chip_data *irq_data;
int ono; int ono;
unsigned long type;
bool wakeup; bool wakeup;
bool wtsr_smpl; bool wtsr_smpl;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment