2018-04-17 14:35:33

by Peter Rosin

[permalink] [raw]
Subject: [PATCH 0/4] i2c: mux: switch to using .probe_new

Hi!

4 trivial patches that switches the existing i2c-mux drivers
that are also i2c clients over to the new probe style.

Cheers,
Peter

Peter Rosin (4):
i2c: mux: ltc4306: switch to using .probe_new
i2c: mux: mlxcpld: switch to using .probe_new
i2c: mux: pca9541: switch to using .probe_new
i2c: mux: pca954x: switch to using .probe_new

drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 +++----
drivers/i2c/muxes/i2c-mux-mlxcpld.c | 5 ++---
drivers/i2c/muxes/i2c-mux-pca9541.c | 5 ++---
drivers/i2c/muxes/i2c-mux-pca954x.c | 7 +++----
4 files changed, 10 insertions(+), 14 deletions(-)

--
2.11.0



2018-04-17 14:34:56

by Peter Rosin

[permalink] [raw]
Subject: [PATCH 2/4] i2c: mux: mlxcpld: switch to using .probe_new

Use the new probe style for i2c drivers.

Signed-off-by: Peter Rosin <[email protected]>
---
drivers/i2c/muxes/i2c-mux-mlxcpld.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-mlxcpld.c b/drivers/i2c/muxes/i2c-mux-mlxcpld.c
index 12ad8d65faf6..2fe86cc81da9 100644
--- a/drivers/i2c/muxes/i2c-mux-mlxcpld.c
+++ b/drivers/i2c/muxes/i2c-mux-mlxcpld.c
@@ -149,8 +149,7 @@ static int mlxcpld_mux_deselect(struct i2c_mux_core *muxc, u32 chan)
}

/* Probe/reomove functions */
-static int mlxcpld_mux_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int mlxcpld_mux_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
struct mlxcpld_mux_plat_data *pdata = dev_get_platdata(&client->dev);
@@ -208,7 +207,7 @@ static struct i2c_driver mlxcpld_mux_driver = {
.driver = {
.name = "mlxcpld-mux",
},
- .probe = mlxcpld_mux_probe,
+ .probe_new = mlxcpld_mux_probe,
.remove = mlxcpld_mux_remove,
.id_table = mlxcpld_mux_id,
};
--
2.11.0


2018-04-17 14:34:56

by Peter Rosin

[permalink] [raw]
Subject: [PATCH 4/4] i2c: mux: pca954x: switch to using .probe_new

Use the new probe style for i2c drivers.

Signed-off-by: Peter Rosin <[email protected]>
---
drivers/i2c/muxes/i2c-mux-pca954x.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index fbb84c7ef282..f3f925ea6472 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -337,8 +337,7 @@ static void pca954x_cleanup(struct i2c_mux_core *muxc)
/*
* I2C init/probing/exit functions
*/
-static int pca954x_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int pca954x_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
struct pca954x_platform_data *pdata = dev_get_platdata(&client->dev);
@@ -382,7 +381,7 @@ static int pca954x_probe(struct i2c_client *client,
if (match)
data->chip = of_device_get_match_data(&client->dev);
else
- data->chip = &chips[id->driver_data];
+ data->chip = &chips[i2c_match_id(pca954x_id, client)->driver_data];

data->last_chan = 0; /* force the first selection */

@@ -466,7 +465,7 @@ static struct i2c_driver pca954x_driver = {
.pm = &pca954x_pm,
.of_match_table = of_match_ptr(pca954x_of_match),
},
- .probe = pca954x_probe,
+ .probe_new = pca954x_probe,
.remove = pca954x_remove,
.id_table = pca954x_id,
};
--
2.11.0


2018-04-17 14:37:00

by Peter Rosin

[permalink] [raw]
Subject: [PATCH 1/4] i2c: mux: ltc4306: switch to using .probe_new

Use the new probe style for i2c drivers.

Signed-off-by: Peter Rosin <[email protected]>
---
drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c
index 311b1cced0c0..a9af93259b19 100644
--- a/drivers/i2c/muxes/i2c-mux-ltc4306.c
+++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c
@@ -206,8 +206,7 @@ static const struct of_device_id ltc4306_of_match[] = {
};
MODULE_DEVICE_TABLE(of, ltc4306_of_match);

-static int ltc4306_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int ltc4306_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
const struct chip_desc *chip;
@@ -221,7 +220,7 @@ static int ltc4306_probe(struct i2c_client *client,
chip = of_device_get_match_data(&client->dev);

if (!chip)
- chip = &chips[id->driver_data];
+ chip = &chips[i2c_match_id(ltc4306_id, client)->driver_data];

idle_disc = device_property_read_bool(&client->dev,
"i2c-mux-idle-disconnect");
@@ -310,7 +309,7 @@ static struct i2c_driver ltc4306_driver = {
.name = "ltc4306",
.of_match_table = of_match_ptr(ltc4306_of_match),
},
- .probe = ltc4306_probe,
+ .probe_new = ltc4306_probe,
.remove = ltc4306_remove,
.id_table = ltc4306_id,
};
--
2.11.0


2018-04-17 17:21:52

by Peter Rosin

[permalink] [raw]
Subject: [PATCH 3/4] i2c: mux: pca9541: switch to using .probe_new

Use the new probe style for i2c drivers.

Signed-off-by: Peter Rosin <[email protected]>
---
drivers/i2c/muxes/i2c-mux-pca9541.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c
index 6a39adaf433f..f61c5de29e2f 100644
--- a/drivers/i2c/muxes/i2c-mux-pca9541.c
+++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
@@ -330,8 +330,7 @@ static int pca9541_release_chan(struct i2c_mux_core *muxc, u32 chan)
/*
* I2C init/probing/exit functions
*/
-static int pca9541_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int pca9541_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = client->adapter;
struct pca954x_platform_data *pdata = dev_get_platdata(&client->dev);
@@ -390,7 +389,7 @@ static struct i2c_driver pca9541_driver = {
.name = "pca9541",
.of_match_table = of_match_ptr(pca9541_of_match),
},
- .probe = pca9541_probe,
+ .probe_new = pca9541_probe,
.remove = pca9541_remove,
.id_table = pca9541_id,
};
--
2.11.0


2018-04-18 09:24:32

by Hennerich, Michael

[permalink] [raw]
Subject: Re: [PATCH 1/4] i2c: mux: ltc4306: switch to using .probe_new

On 17.04.2018 16:32, Peter Rosin wrote:
> Use the new probe style for i2c drivers.
>
> Signed-off-by: Peter Rosin <[email protected]>

Thanks Peter,

Don't know why i2c needs a new probe style to save one function parameter...
But this patch looks otherwise good to me.

Acked-by: Michael Hennerich <[email protected]>

> ---
> drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c
> index 311b1cced0c0..a9af93259b19 100644
> --- a/drivers/i2c/muxes/i2c-mux-ltc4306.c
> +++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c
> @@ -206,8 +206,7 @@ static const struct of_device_id ltc4306_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, ltc4306_of_match);
>
> -static int ltc4306_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> +static int ltc4306_probe(struct i2c_client *client)
> {
> struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
> const struct chip_desc *chip;
> @@ -221,7 +220,7 @@ static int ltc4306_probe(struct i2c_client *client,
> chip = of_device_get_match_data(&client->dev);
>
> if (!chip)
> - chip = &chips[id->driver_data];
> + chip = &chips[i2c_match_id(ltc4306_id, client)->driver_data];
>
> idle_disc = device_property_read_bool(&client->dev,
> "i2c-mux-idle-disconnect");
> @@ -310,7 +309,7 @@ static struct i2c_driver ltc4306_driver = {
> .name = "ltc4306",
> .of_match_table = of_match_ptr(ltc4306_of_match),
> },
> - .probe = ltc4306_probe,
> + .probe_new = ltc4306_probe,
> .remove = ltc4306_remove,
> .id_table = ltc4306_id,
> };
>


--
Greetings,
Michael

--
Analog Devices GmbH Otl-Aicher Strasse 60-64 80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne

2018-05-19 21:57:16

by Peter Rosin

[permalink] [raw]
Subject: Re: [PATCH 1/4] i2c: mux: ltc4306: switch to using .probe_new

On 2018-04-18 11:26, Michael Hennerich wrote:
> On 17.04.2018 16:32, Peter Rosin wrote:
>> Use the new probe style for i2c drivers.
>>
>> Signed-off-by: Peter Rosin <[email protected]>
>
> Thanks Peter,
>
> Don't know why i2c needs a new probe style to save one function parameter...
> But this patch looks otherwise good to me.
>
> Acked-by: Michael Hennerich <[email protected]>

Thanks, added this patch to i2c-mux/for-next

Cheers,
Peter

>> ---
>> drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c
>> index 311b1cced0c0..a9af93259b19 100644
>> --- a/drivers/i2c/muxes/i2c-mux-ltc4306.c
>> +++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c
>> @@ -206,8 +206,7 @@ static const struct of_device_id ltc4306_of_match[] = {
>> };
>> MODULE_DEVICE_TABLE(of, ltc4306_of_match);
>>
>> -static int ltc4306_probe(struct i2c_client *client,
>> - const struct i2c_device_id *id)
>> +static int ltc4306_probe(struct i2c_client *client)
>> {
>> struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
>> const struct chip_desc *chip;
>> @@ -221,7 +220,7 @@ static int ltc4306_probe(struct i2c_client *client,
>> chip = of_device_get_match_data(&client->dev);
>>
>> if (!chip)
>> - chip = &chips[id->driver_data];
>> + chip = &chips[i2c_match_id(ltc4306_id, client)->driver_data];
>>
>> idle_disc = device_property_read_bool(&client->dev,
>> "i2c-mux-idle-disconnect");
>> @@ -310,7 +309,7 @@ static struct i2c_driver ltc4306_driver = {
>> .name = "ltc4306",
>> .of_match_table = of_match_ptr(ltc4306_of_match),
>> },
>> - .probe = ltc4306_probe,
>> + .probe_new = ltc4306_probe,
>> .remove = ltc4306_remove,
>> .id_table = ltc4306_id,
>> };
>>
>
>