Re: [PATCH v2 1/3] mfd: tqmx86: do not access I2C_DETECT register through io_base
From: Andrew Lunn
Date: Mon Feb 20 2023 - 08:48:46 EST
On Mon, Feb 20, 2023 at 12:25:44PM +0100, Matthias Schiffer wrote:
> The I2C_DETECT register is at IO port 0x1a7, which is outside the range
> passed to devm_ioport_map() for io_base, and was only working because
> there aren't actually any bounds checks for IO port accesses.
>
> Extending the range does not seem like a good solution here, as it would
> then conflict with the IO resource assigned to the I2C controller. As
> this is just a one-off access during probe, use a simple inb() instead.
>
> While we're at it, drop the unused define TQMX86_REG_I2C_INT_EN.
>
> Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew