We noticed a mistake in a few MediaTek drivers where we were checking the return value of dev_remap_addr() and friends with IS_ERR(), but it only ever returns NULL on failure.
Then we saw that we were not the only ones who did this. So here is a series to clean it all up at once. The return values are a bit inconsistent, but -EINVAL seems to be the most common, so that is what is used in places that didn't already have a specific error code or established convention in the file itself. There were also a few cases that used IS_ERR_OR_NULL(), which isn't a bug like IS_ERR(), but we clean them up too for correctness. There are some places that don't check the return value, but I didn't look into if those should be considered bugs or not. Custodians: feel free to pick up any patches for your subsystem. And I can take what is left through the MediaTek tree in a few weeks. Signed-off-by: David Lechner <[email protected]> --- David Lechner (14): power: pmic: mtk-pwrap: check dev_remap_addr() for NULL net: mt7628-eth: check dev_remap_addr_index() for NULL net: airoha_eth: check dev_remap_addr_name() for NULL net: hifemac: check dev_remap_addr_name() for NULL net: hifemac_mdio: check dev_remap_addr() for NULL usb: dwc3-octeon-glue: check dev_remap_addr() for NULL usb: dwc3-am62: check dev_remap_addr_index() for NULL timer: mchp-pit64b: check dev_read_addr_ptr() for NULL phy: qcom: snps-femto-v2: check dev_read_addr_ptr() for NULL phy: rockchip: inno-dsidphy: check dev_read_addr_ptr() for NULL pinctrl: aspeed: ast2600: check dev_read_addr_ptr() for NULL reset: ast2500: check dev_read_addr_ptr() for NULL reset: ast2600: check dev_read_addr_ptr() for NULL arm: aspeed: ast2600: check devfdt_get_addr_ptr() for NULL arch/arm/mach-aspeed/ast2600/board_common.c | 3 +-- arch/arm/mach-aspeed/ast2600/spl.c | 3 +-- drivers/net/airoha_eth.c | 4 ++-- drivers/net/hifemac.c | 2 +- drivers/net/hifemac_mdio.c | 9 ++++----- drivers/net/mt7628-eth.c | 10 +++++----- drivers/phy/qcom/phy-qcom-snps-femto-v2.c | 5 +++-- drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 5 +++-- drivers/pinctrl/aspeed/pinctrl_ast2600.c | 5 ++--- drivers/power/pmic/mtk-pwrap.c | 4 ++-- drivers/reset/reset-ast2500.c | 4 ++-- drivers/reset/reset-ast2600.c | 4 ++-- drivers/timer/mchp-pit64b-timer.c | 4 ++-- drivers/usb/dwc3/dwc3-am62.c | 2 +- drivers/usb/host/dwc3-octeon-glue.c | 5 ++--- 15 files changed, 33 insertions(+), 36 deletions(-) --- base-commit: 1c5004ffc5e3f000eca6cada32af7c83bd925c2b change-id: 20260903-b4-dm-addr-null-checks-85b1450fa045 Best regards, -- David Lechner <[email protected]>
