Re: [PATCH v3 3/5] i2c: pca-platform: add devicetree awareness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/06/17 21:20, Andy Shevchenko wrote:
>> +       i2c->adap.dev.of_node = np;
>> +       } else if (np) {
>> +               i2c->adap.timeout = HZ;
>> +               i2c->gpio = devm_gpiod_get_optional(&pdev->dev, "reset-gpios", GPIOD_OUT_LOW);
>> +               if (IS_ERR(i2c->gpio))
>> +                       return PTR_ERR(i2c->gpio);
>> +               of_property_read_u32_index(np, "clock-frequency", 0,
>> +                                          &i2c->algo_data.i2c_clock);
> And what prevents you to use device_property_read_*() here and get rid
> of OFstuff?
> 

Nothing particular. I think I just found more instances of parsing a 
"clock-frequency" this way. Happy to change this.

>> +#ifdef CONFIG_OF
> Better not to put it...
> 
>> +               .of_match_table = of_match_ptr(i2c_pca_of_match_table),
> ...and get rid of of_match_ptr().

So what's the current best practice with this? I gather the intent is to 
keep the kernel size down by only including the of_match tables on 
platforms that actually use a device tree. There are just shy of 1000 
instances of of_match_ptr in the current tree (a handful of which are in 
drivers/i2c). Have we now reached a point where there are more dt-aware 
platforms than unaware ones?





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux