瀏覽代碼

i2c: mux: mlxcpld: simplify code to reach the adapter

struct i2c_client has a direct pointer to the adapter, no need to dig
it out of the struct device tree.

Suggested-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Peter Rosin <peda@axentia.se>
Luca Ceresoli 6 年之前
父節點
當前提交
7451dc6085
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/i2c/muxes/i2c-mux-mlxcpld.c

+ 1 - 1
drivers/i2c/muxes/i2c-mux-mlxcpld.c

@@ -132,7 +132,7 @@ static int mlxcpld_mux_deselect(struct i2c_mux_core *muxc, u32 chan)
 static int mlxcpld_mux_probe(struct i2c_client *client,
 			     const struct i2c_device_id *id)
 {
-	struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
+	struct i2c_adapter *adap = client->adapter;
 	struct mlxcpld_mux_plat_data *pdata = dev_get_platdata(&client->dev);
 	struct i2c_mux_core *muxc;
 	int num, force;