i2c: fsi: Prevent adding adapters for ports without dts nodes
authorEddie James <eajames@linux.ibm.com>
Tue, 9 Jun 2020 20:15:55 +0000 (15:15 -0500)
committerWolfram Sang <wsa@kernel.org>
Fri, 24 Jul 2020 19:31:33 +0000 (21:31 +0200)
Ports should be defined in the devicetree if they are to be enabled on
the system.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-fsi.c

index 977d6f524649cdf5f626290900957b4207487349..10332693edf0d93663fb35fba9404a6209fc2153 100644 (file)
@@ -703,7 +703,7 @@ static int fsi_i2c_probe(struct device *dev)
 
        for (port_no = 0; port_no < ports; port_no++) {
                np = fsi_i2c_find_port_of_node(dev->of_node, port_no);
-               if (np && !of_device_is_available(np))
+               if (!of_device_is_available(np))
                        continue;
 
                port = kzalloc(sizeof(*port), GFP_KERNEL);