i2c: rtl9300: fix channel number bound check

Fix the current check for number of channels (child nodes in the device
tree). Before, this was:

if (device_get_child_node_count(dev) >= RTL9300_I2C_MUX_NCHAN)

RTL9300_I2C_MUX_NCHAN gives the maximum number of channels so checking
with '>=' isn't correct because it doesn't allow the last channel
number. Thus, fix it to:

if (device_get_child_node_count(dev) > RTL9300_I2C_MUX_NCHAN)

Issue occured on a TP-Link TL-ST1008F v2.0 device (8 SFP+ ports) and fix
is tested there.

Fixes: c366be720235 ("i2c: Add driver for the RTL9300 I2C controller")
Cc: stable@vger.kernel.org # v6.13+
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250831100457.3114-2-jelonek.jonas@gmail.com

authored by Jonas Jelonek and committed by Andi Shyti cd6c956f 664596bd

+1 -1
+1 -1
drivers/i2c/busses/i2c-rtl9300.c
··· 353 354 platform_set_drvdata(pdev, i2c); 355 356 - if (device_get_child_node_count(dev) >= RTL9300_I2C_MUX_NCHAN) 357 return dev_err_probe(dev, -EINVAL, "Too many channels\n"); 358 359 device_for_each_child_node(dev, child) {
··· 353 354 platform_set_drvdata(pdev, i2c); 355 356 + if (device_get_child_node_count(dev) > RTL9300_I2C_MUX_NCHAN) 357 return dev_err_probe(dev, -EINVAL, "Too many channels\n"); 358 359 device_for_each_child_node(dev, child) {