static inline int rk29_i2c_register_cpufreq(struct rk29_i2c_data *i2c)
{
+ if (i2c->adap.nr != 0)
+ return 0;
i2c->freq_transition.notifier_call = rk29_i2c_cpufreq_transition;
return cpufreq_register_notifier(&i2c->freq_transition,
static inline void rk29_i2c_unregister_cpufreq(struct rk29_i2c_data *i2c)
{
+ if (i2c->adap.nr != 0)
+ return;
cpufreq_unregister_notifier(&i2c->freq_transition,
CPUFREQ_TRANSITION_NOTIFIER);
}
i2c->adap.owner = THIS_MODULE;
i2c->adap.algo = &rk29_i2c_algorithm;
i2c->adap.class = I2C_CLASS_HWMON;
+ i2c->adap.nr = pdata->bus_num;
spin_lock_init(&i2c->cmd_lock);
i2c->dev = &pdev->dev;
goto err_irq;
}
- i2c->adap.nr = pdata->bus_num;
ret = i2c_add_numbered_adapter(&i2c->adap);
if (ret < 0) {
i2c_err(&pdev->dev, "failed to add bus to i2c core\n");