@@ -129,8 +129,8 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)
}
}
-int sec_pmic_probe(struct device *dev, unsigned long device_type,
- unsigned int irq, struct regmap *regmap,
+int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
+ struct regmap *regmap,
const struct sec_pmic_probe_data *probedata,
struct i2c_client *client)
{
@@ -214,7 +214,7 @@ int sec_pmic_probe(struct device *dev, unsigned long device_type,
break;
default:
return dev_err_probe(sec_pmic->dev, -EINVAL,
- "Unsupported device type %lu\n",
+ "Unsupported device type %d\n",
sec_pmic->device_type);
}
ret = devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs,
@@ -248,7 +248,7 @@ void sec_pmic_shutdown(struct device *dev)
* ignore the rest.
*/
dev_warn(sec_pmic->dev,
- "Unsupported device %lu for manual power off\n",
+ "Unsupported device %d for manual power off\n",
sec_pmic->device_type);
return;
}
@@ -21,8 +21,8 @@ struct sec_pmic_probe_data {
bool disable_wrstbi;
};
-int sec_pmic_probe(struct device *dev, unsigned long device_type,
- unsigned int irq, struct regmap *regmap,
+int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
+ struct regmap *regmap,
const struct sec_pmic_probe_data *probedata,
struct i2c_client *client);
void sec_pmic_shutdown(struct device *dev);
@@ -27,7 +27,7 @@
struct sec_pmic_i2c_platform_data {
const struct regmap_config *regmap_cfg;
- unsigned long device_type;
+ int device_type;
};
static bool s2mpa01_volatile(struct device *dev, unsigned int reg)
@@ -450,10 +450,9 @@ static const struct regmap_irq_chip s5m8767_irq_chip = {
int sec_irq_init(struct sec_pmic_dev *sec_pmic)
{
int ret = 0;
- int type = sec_pmic->device_type;
const struct regmap_irq_chip *sec_irq_chip;
- switch (type) {
+ switch (sec_pmic->device_type) {
case S5M8767X:
sec_irq_chip = &s5m8767_irq_chip;
break;
@@ -485,7 +484,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
break;
default:
return dev_err_probe(sec_pmic->dev, -EINVAL,
- "Unsupported device type %lu\n",
+ "Unsupported device type %d\n",
sec_pmic->device_type);
}
@@ -67,7 +67,7 @@ struct sec_pmic_dev {
struct regmap *regmap_pmic;
struct i2c_client *i2c;
- unsigned long device_type;
+ int device_type;
int irq;
struct regmap_irq_chip_data *irq_data;
};
Now that sec-i2c doesn't match device type by pointer casting anymore, we can switch the device type from unsigned long to int easily. This saves a few bytes in struct sec_pmic_dev due to member alignment. Signed-off-by: André Draszik <andre.draszik@linaro.org> --- drivers/mfd/sec-common.c | 8 ++++---- drivers/mfd/sec-core.h | 4 ++-- drivers/mfd/sec-i2c.c | 2 +- drivers/mfd/sec-irq.c | 5 ++--- include/linux/mfd/samsung/core.h | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-)