Hello Henry,

On Thu, Jul 23, 2015 at 1:04 PM, Henry Chen <henryc.c...@mediatek.com> wrote:
> On Thu, 2015-07-23 at 11:07 +0200, Javier Martinez Canillas wrote:
>
>> > +
>> > +       if (ret < 0)
>> > +               dev_err(&i2c->dev, "Failed to initialize regulator: %d\n", 
>> > ret);
>> > +
>>
>> I don't think this is necessary, you are already adding logs for all
>> the error conditions.
>
> Yes, I will remove it.
>
>>
>> > +       return ret;
>> > +}
>> > +
>> > +static const struct i2c_device_id mt6311_i2c_id[] = {
>> > +       {"mt6311", 0},
>> > +       {},
>> > +};
>> > +MODULE_DEVICE_TABLE(i2c, mt6311_i2c_id);
>> > +
>> > +#ifdef CONFIG_OF
>> > +static const struct of_device_id mt6311_dt_ids[] = {
>> > +       { .compatible = "mediatek,mt6311-regulator",
>> > +         .data = &mt6311_i2c_id[0] },
>> > +       {},
>> > +};
>> > +MODULE_DEVICE_TABLE(of, mt6311_dt_ids);
>> > +#endif
>> > +
>> > +static struct i2c_driver mt6311_regulator_driver = {
>> > +       .driver = {
>> > +               .name = "mt6311",
>> > +               .owner = THIS_MODULE,
>> > +               .of_match_table = of_match_ptr(mt6311_dt_ids),
>>
>> of_match_ptr() is NULL when CONFIG_OF is not defined so you don't need
>> the additional #ifdef
>> CONFIG_OF around mt6311_dt_ids.
>
> If CONFIG_OF is not defined and without #ifdef CONFIG_OF around
> mt6311_dt_ids, it will allocate a struct mt6311_dt_ids but no one used
> on here, right?
>

You are right, sorry for the noise.

> Henry
>

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to