]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
phy: apple: apple: Use local variable for ioremap return value
authorJanne Grunau <j@jannau.net>
Sun, 15 Feb 2026 08:02:51 +0000 (09:02 +0100)
committerVinod Koul <vkoul@kernel.org>
Fri, 27 Feb 2026 15:02:39 +0000 (20:32 +0530)
commit290a35756aaef85bbe0527eaf451f533a61b5f6c
treeb1c72882601ed363f40bd4d5c887a9219f34c589
parentb6b7d1ae0653dcaa356be31c0de221311e922ccd
phy: apple: apple: Use local variable for ioremap return value

The indirection through the resources array is unnecessarily complicated
and resuling in using IS_ERR() and PTR_ERR() on a valid address. A local
variable for the devm_ioremap_resource() return value is both easier to
read and matches expectations when reading code.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/asahi/aYXvX1bYOXtYCgfC@stanley.mountain/
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY")
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Sven Peter <sven@kernel.org>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/20260215-phy-apple-resource-err-ptr-v2-1-e43c22453682@jannau.net
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/apple/atc.c