lkml.org 
[lkml]   [2015]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 2/2] regulator: mt6311: Add support for mt6311 regulator
From
Hello Henry,

On Thu, Jul 23, 2015 at 1:04 PM, Henry Chen <HenryC.Chen@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


\
 
 \ /
  Last update: 2015-07-23 16:41    [W:0.541 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site