Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: davinci: use generic device property accessors

Don't use generic OF APIs if the generic device-level ones will do.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20241211102337.37956-3-brgl@bgdev.pl
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Bartosz Golaszewski and committed by
Andi Shyti
8abbc711 7d2b31f8

+3 -4
+3 -4
drivers/i2c/busses/i2c-davinci.c
··· 23 23 #include <linux/io.h> 24 24 #include <linux/kernel.h> 25 25 #include <linux/module.h> 26 - #include <linux/of.h> 27 26 #include <linux/platform_device.h> 28 27 #include <linux/pm_runtime.h> 28 + #include <linux/property.h> 29 29 #include <linux/sched.h> 30 30 #include <linux/slab.h> 31 31 ··· 173 173 u32 clkh; 174 174 u32 clkl; 175 175 u32 input_clock = clk_get_rate(dev->clk); 176 - struct device_node *of_node = dev->dev->of_node; 177 176 178 177 /* NOTE: I2C Clock divider programming info 179 178 * As per I2C specs the following formulas provide prescaler ··· 206 207 psc++; /* better to run under spec than over */ 207 208 d = (psc >= 2) ? 5 : 7 - psc; 208 209 209 - if (of_node && of_device_is_compatible(of_node, "ti,keystone-i2c")) 210 + if (device_is_compatible(dev->dev, "ti,keystone-i2c")) 210 211 d = 6; 211 212 212 213 clk = ((input_clock / (psc + 1)) / (dev->bus_freq * 1000)); ··· 810 811 adap->algo = &i2c_davinci_algo; 811 812 adap->dev.parent = &pdev->dev; 812 813 adap->timeout = DAVINCI_I2C_TIMEOUT; 813 - adap->dev.of_node = pdev->dev.of_node; 814 + adap->dev.of_node = dev_of_node(&pdev->dev); 814 815 815 816 if (dev->has_pfunc) 816 817 adap->bus_recovery_info = &davinci_i2c_scl_recovery_info;