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

gpio: davinci: use generic device properties

OF-specific routines should not be used unless necessary. Generic device
properties are preferred so switch to using them in the driver code.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20241007103440.38416-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+3 -5
+3 -5
drivers/gpio/gpio-davinci.c
··· 15 15 #include <linux/irq.h> 16 16 #include <linux/irqdomain.h> 17 17 #include <linux/module.h> 18 - #include <linux/of.h> 19 18 #include <linux/pinctrl/consumer.h> 20 19 #include <linux/platform_device.h> 21 20 #include <linux/property.h> ··· 158 159 unsigned int ngpio, nbank, nirq, gpio_unbanked; 159 160 struct davinci_gpio_controller *chips; 160 161 struct device *dev = &pdev->dev; 161 - struct device_node *dn = dev_of_node(dev); 162 162 163 163 /* 164 164 * The gpio banks conceptually expose a segmented bitmap, 165 165 * and "ngpio" is one more than the largest zero-based 166 166 * bit index that's valid. 167 167 */ 168 - ret = of_property_read_u32(dn, "ti,ngpio", &ngpio); 168 + ret = device_property_read_u32(dev, "ti,ngpio", &ngpio); 169 169 if (ret) 170 170 return dev_err_probe(dev, ret, "Failed to get the number of GPIOs\n"); 171 171 if (ngpio == 0) ··· 175 177 * interrupts is equal to number of gpios else all are banked so 176 178 * number of interrupts is equal to number of banks(each with 16 gpios) 177 179 */ 178 - ret = of_property_read_u32(dn, "ti,davinci-gpio-unbanked", 179 - &gpio_unbanked); 180 + ret = device_property_read_u32(dev, "ti,davinci-gpio-unbanked", 181 + &gpio_unbanked); 180 182 if (ret) 181 183 return dev_err_probe(dev, ret, "Failed to get the unbanked GPIOs property\n"); 182 184