diff options
author | Vadim Pasternak <vadimp@nvidia.com> | 2021-02-08 22:16:03 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-02-09 11:35:28 +0100 |
commit | cae5216387d18c888f9f38a0cf5be341a0af75a6 (patch) | |
tree | 23352f4404394533086945cb5e34728847af0b31 /drivers/i2c | |
parent | 81566938083af15aec75201293cf6047bb04f4d3 (diff) | |
download | linux-stable-cae5216387d18c888f9f38a0cf5be341a0af75a6.tar.gz linux-stable-cae5216387d18c888f9f38a0cf5be341a0af75a6.tar.bz2 linux-stable-cae5216387d18c888f9f38a0cf5be341a0af75a6.zip |
i2c: mux: mlxcpld: Get rid of adapter numbers enforcement
Do not set the argument 'force_nr' of i2c_mux_add_adapter() routine,
instead provide argument 'chan_id'.
Rename mux ids array from 'adap_ids' to 'chan_ids'.
The motivation is to prepare infrastructure to be able to:
- Create only the child adapters which are actually needed - for which
channel ids are specified.
- To assign 'nrs' to these child adapters dynamically, with no 'nr'
enforcement.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-mlxcpld.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-mlxcpld.c b/drivers/i2c/muxes/i2c-mux-mlxcpld.c index 113ad84cdd94..e99a7ad09886 100644 --- a/drivers/i2c/muxes/i2c-mux-mlxcpld.c +++ b/drivers/i2c/muxes/i2c-mux-mlxcpld.c @@ -101,9 +101,8 @@ static int mlxcpld_mux_probe(struct platform_device *pdev) struct mlxcpld_mux_plat_data *pdata = dev_get_platdata(&pdev->dev); struct i2c_client *client = to_i2c_client(pdev->dev.parent); struct i2c_mux_core *muxc; - int num, force; struct mlxcpld_mux *data; - int err; + int num, err; if (!pdata) return -EINVAL; @@ -130,9 +129,7 @@ static int mlxcpld_mux_probe(struct platform_device *pdev) /* discard unconfigured channels */ break; - force = pdata->adap_ids[num]; - - err = i2c_mux_add_adapter(muxc, force, num, 0); + err = i2c_mux_add_adapter(muxc, 0, pdata->chan_ids[num], 0); if (err) goto virt_reg_failed; } |