]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
of: unittest: simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 10 Jun 2019 09:51:56 +0000 (11:51 +0200)
committerRob Herring <robh@kernel.org>
Tue, 9 Jul 2019 02:23:35 +0000 (20:23 -0600)
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Reported-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c

index 3832a5de4602f0a95895ebcb956a913a2068281d..e6b175370f2eb9f80393cf10f1c4647fa9615563 100644 (file)
@@ -1946,7 +1946,7 @@ static int unittest_i2c_mux_probe(struct i2c_client *client,
 {
        int i, nchans;
        struct device *dev = &client->dev;
-       struct i2c_adapter *adap = to_i2c_adapter(dev->parent);
+       struct i2c_adapter *adap = client->adapter;
        struct device_node *np = client->dev.of_node, *child;
        struct i2c_mux_core *muxc;
        u32 reg, max_reg;