u-boot-brain/drivers/gpio
Masahiro Yamada 3c12c62ba5 treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr()
Use the _ptr suffixed variant instead of casting. Also, convert it to
dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE.

One curious part is an error check like follows in
drivers/watchdog/omap_wdt.c:

    priv->regs = (struct wd_timer *)devfdt_get_addr(dev);
    if (!priv->regs)
            return -EINVAL;

devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error.
So, this code does not catch any error in DT parsing.

dev_read_addr_ptr() returns NULL on error, so this error check
will work.

I generated this commit by the following command:

 $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \
   xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/'

I manually fixed drivers/usb/host/ehci-mx6.c

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-07-20 11:37:47 -06:00
..
74x164_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
adi_gpio2.c common: Drop linux/bug.h from common header 2020-05-18 21:19:23 -04:00
altera_pio.c gpio: altera_pio: fix get_value 2019-02-25 16:07:36 +01:00
at91_gpio.c drivers: rename drivers to match compatible string 2020-07-09 18:57:22 -06:00
atmel_pio4.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
axp_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcm2835_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcm6345_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cortina_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
da8xx_gpio.c drivers: rename drivers to match compatible string 2020-07-09 18:57:22 -06:00
da8xx_gpio.h dm: gpio: Allow control of GPIO uclass in SPL 2019-12-15 08:52:29 +08:00
db8500_gpio.c GPIO: Correct doc typo "confguration" -> "configuration" 2017-02-08 16:24:29 -05:00
dwapb_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
gpio-rcar.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-20 11:37:47 -06:00
gpio-rza1.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
gpio-uclass.c gpio: Add a method to convert a GPIO to ACPI 2020-07-17 14:32:24 +08:00
gpio-uniphier.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
hi6220_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
hsdk-creg-gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
imx_rgpio2p.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
intel_broadwell_gpio.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
intel_gpio.c x86: gpio: Add support for obtaining ACPI info for a GPIO 2020-07-17 14:32:24 +08:00
intel_ich6_gpio.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
Kconfig gpio: search for gpio label if gpio is not found through bank name 2020-07-07 18:23:37 -04:00
kona_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
kw_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lpc32xx_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile gpio/mpc83xx_spisel_boot.c: gpio driver for SPISEL_BOOT signal 2020-03-31 10:06:52 -04:00
mpc8xxx_gpio.c gpio: remove the open_drain API and ops 2020-04-16 23:06:54 -04:00
mpc83xx_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
mpc83xx_spisel_boot.c gpio/mpc83xx_spisel_boot.c: gpio driver for SPISEL_BOOT signal 2020-03-31 10:06:52 -04:00
mscc_sgpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
msm_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mt7621_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mvebu_gpio.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-20 11:37:47 -06:00
mvgpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
mvgpio.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mvmfp.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxc_gpio.c gpio: mxc_gpio: Improve to use ofdata_to_platdata 2020-07-16 11:19:57 +02:00
mxs_gpio.c core: add support for U_BOOT_DRIVER_ALIAS 2020-07-09 18:57:22 -06:00
omap_gpio.c gpio: omap_gpio: Fix unused function warning in non-DM case 2020-06-16 17:00:02 +05:30
pca953x_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
pca953x.c command: Remove the cmd_tbl_t typedef 2020-05-18 18:36:55 -04:00
pca9698.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
pcf8575_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
pic32_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
pm8916_gpio.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
rk_gpio.c drivers: rename drivers to match compatible string 2020-07-09 18:57:22 -06:00
s5p_gpio.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-20 11:37:47 -06:00
sandbox.c gpio: Add a method to convert a GPIO to ACPI 2020-07-17 14:32:24 +08:00
sh_pfc.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
sifive-gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
spear_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
stm32_gpio.c gpio: stm32: add ops get_dir_flags 2020-07-07 16:01:23 +02:00
sunxi_gpio.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-20 11:37:47 -06:00
tca642x.c command: Remove the cmd_tbl_t typedef 2020-05-18 18:36:55 -04:00
tegra_gpio.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
tegra186_gpio_priv.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra186_gpio.c gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers 2018-11-14 09:16:28 -08:00
vybrid_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
xilinx_gpio.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
zynq_gpio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00