static int s5m_rtc_probe(struct platform_device *pdev)
{
struct sec_pmic_dev *s5m87xx = dev_get_drvdata(pdev->dev.parent);
+ enum sec_device_type device_type =
+ platform_get_device_id(pdev)->driver_data;
struct s5m_rtc_info *info;
struct i2c_client *i2c;
const struct regmap_config *regmap_cfg;
if (!info)
return -ENOMEM;
- switch (platform_get_device_id(pdev)->driver_data) {
+ switch (device_type) {
case S2MPS15X:
regmap_cfg = &s2mps14_rtc_regmap_config;
info->regs = &s2mps15_rtc_regs;
break;
default:
return dev_err_probe(&pdev->dev, -ENODEV,
- "Device type %lu is not supported by RTC driver\n",
- platform_get_device_id(pdev)->driver_data);
+ "Device type %d is not supported by RTC driver\n",
+ device_type);
}
i2c = devm_i2c_new_dummy_device(&pdev->dev, s5m87xx->i2c->adapter,
info->dev = &pdev->dev;
info->s5m87xx = s5m87xx;
- info->device_type = platform_get_device_id(pdev)->driver_data;
+ info->device_type = device_type;
if (s5m87xx->irq_data) {
info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);