2022-11-18 23:50:29

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 509/606] of: unittest: Convert to i2c's .probe_new()

From: Uwe Kleine-König <[email protected]>

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/of/unittest.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 1d810c0e18f8..bc0f1e50a4be 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2508,8 +2508,7 @@ static struct platform_driver unittest_i2c_bus_driver = {
},
};

-static int unittest_i2c_dev_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int unittest_i2c_dev_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct device_node *np = client->dev.of_node;
@@ -2541,7 +2540,7 @@ static struct i2c_driver unittest_i2c_dev_driver = {
.driver = {
.name = "unittest-i2c-dev",
},
- .probe = unittest_i2c_dev_probe,
+ .probe_new = unittest_i2c_dev_probe,
.remove = unittest_i2c_dev_remove,
.id_table = unittest_i2c_dev_id,
};
@@ -2553,8 +2552,7 @@ static int unittest_i2c_mux_select_chan(struct i2c_mux_core *muxc, u32 chan)
return 0;
}

-static int unittest_i2c_mux_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int unittest_i2c_mux_probe(struct i2c_client *client)
{
int i, nchans;
struct device *dev = &client->dev;
@@ -2619,7 +2617,7 @@ static struct i2c_driver unittest_i2c_mux_driver = {
.driver = {
.name = "unittest-i2c-mux",
},
- .probe = unittest_i2c_mux_probe,
+ .probe_new = unittest_i2c_mux_probe,
.remove = unittest_i2c_mux_remove,
.id_table = unittest_i2c_mux_id,
};
--
2.38.1



2022-11-21 01:59:00

by Frank Rowand

[permalink] [raw]
Subject: Re: [PATCH 509/606] of: unittest: Convert to i2c's .probe_new()

On 11/18/22 16:44, Uwe Kleine-König wrote:
> From: Uwe Kleine-König <[email protected]>

Add a prefix to the existing patch comment:

In struct i2c_driver, field new_probe replaces the soon to be deprecated
field probe. Update unittest for this change.

>
> The probe function doesn't make use of the i2c_device_id * parameter so it
> can be trivially converted.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> ---

Rob,

In patch 000/606 Uwe asks maintainers to pick up the individual patches
in their tree, so please pick up 509/606.

> drivers/of/unittest.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 1d810c0e18f8..bc0f1e50a4be 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -2508,8 +2508,7 @@ static struct platform_driver unittest_i2c_bus_driver = {
> },
> };
>
> -static int unittest_i2c_dev_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> +static int unittest_i2c_dev_probe(struct i2c_client *client)
> {
> struct device *dev = &client->dev;
> struct device_node *np = client->dev.of_node;
> @@ -2541,7 +2540,7 @@ static struct i2c_driver unittest_i2c_dev_driver = {
> .driver = {
> .name = "unittest-i2c-dev",
> },
> - .probe = unittest_i2c_dev_probe,
> + .probe_new = unittest_i2c_dev_probe,
> .remove = unittest_i2c_dev_remove,
> .id_table = unittest_i2c_dev_id,
> };
> @@ -2553,8 +2552,7 @@ static int unittest_i2c_mux_select_chan(struct i2c_mux_core *muxc, u32 chan)
> return 0;
> }
>
> -static int unittest_i2c_mux_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> +static int unittest_i2c_mux_probe(struct i2c_client *client)
> {
> int i, nchans;
> struct device *dev = &client->dev;
> @@ -2619,7 +2617,7 @@ static struct i2c_driver unittest_i2c_mux_driver = {
> .driver = {
> .name = "unittest-i2c-mux",
> },
> - .probe = unittest_i2c_mux_probe,
> + .probe_new = unittest_i2c_mux_probe,
> .remove = unittest_i2c_mux_remove,
> .id_table = unittest_i2c_mux_id,
> };

Reviewed by visual inspection. Did not do my normal build, test, check for
warnings.

Reviewed-by: Frank Rowand <[email protected]>

2022-11-22 22:36:03

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 509/606] of: unittest: Convert to i2c's .probe_new()

On Fri, 18 Nov 2022 23:44:03 +0100, Uwe Kleine-K?nig wrote:
> From: Uwe Kleine-K?nig <[email protected]>
>
> The probe function doesn't make use of the i2c_device_id * parameter so it
> can be trivially converted.
>
> Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> ---
> drivers/of/unittest.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>

Applied, thanks!