[PATCH phy-next v2] phy: apple: apple: Use local variable for ioremap return value

Vladimir Oltean olteanv at gmail.com
Mon Feb 16 01:04:56 PST 2026


On Sun, Feb 15, 2026 at 09:02:51AM +0100, Janne Grunau wrote:
> 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 at linaro.org>
> Closes: https://lore.kernel.org/asahi/aYXvX1bYOXtYCgfC@stanley.mountain/
> Suggested-by: Vladimir Oltean <olteanv at gmail.com>
> Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY")
> Signed-off-by: Janne Grunau <j at jannau.net>
> ---
> Changes in v2:
> - Use a local variable instead of the complex indirection with the
>   resources array
> - Link to v1: https://lore.kernel.org/r/20260207-phy-apple-resource-err-ptr-v1-1-78735b07ed2d@jannau.net
> ---

Reviewed-by: Vladimir Oltean <olteanv at gmail.com>

I hope this can be picked up for the linux-phy PR.



More information about the linux-arm-kernel mailing list