Re: [PATCH phy-next v2] phy: apple: apple: Use local variable for ioremap return value
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2026-02-16 09:05:00
Also in:
asahi, linux-phy, lkml
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2026-02-16 09:05:00
Also in:
asahi, linux-phy, lkml
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 <redacted> Closes: https://lore.kernel.org/asahi/aYXvX1bYOXtYCgfC@stanley.mountain/ (local) Suggested-by: Vladimir Oltean <olteanv@gmail.com> Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY") Signed-off-by: Janne Grunau <j@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 (local) ---
Reviewed-by: Vladimir Oltean <olteanv@gmail.com> I hope this can be picked up for the linux-phy PR.