diff mbox series

[RFC,v2,3/6] i2c: aspeed: Don't report error when optional dt bus-frequency not supplied

Message ID 20230530145601.2592-4-Jonathan.Cameron@huawei.com
State Superseded
Headers show
Series i2c: Enabling use of aspeed-i2c with ACPI | expand

Commit Message

Jonathan Cameron May 30, 2023, 2:55 p.m. UTC
The bindings have this property as optional with a default of 100kHz.
As such the driver should not be printing an error message if it is not
supplied.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
v2: New patch after Andy raised some questions about this property
    and I read the binding doc.
---
 drivers/i2c/busses/i2c-aspeed.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Andy Shevchenko May 30, 2023, 7:47 p.m. UTC | #1
On Tue, May 30, 2023 at 5:57 PM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> The bindings have this property as optional with a default of 100kHz.
> As such the driver should not be printing an error message if it is not
> supplied.

Right
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> v2: New patch after Andy raised some questions about this property
>     and I read the binding doc.
> ---
>  drivers/i2c/busses/i2c-aspeed.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
> index 21a2f139f445..4363bfe06f9b 100644
> --- a/drivers/i2c/busses/i2c-aspeed.c
> +++ b/drivers/i2c/busses/i2c-aspeed.c
> @@ -1003,13 +1003,9 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
>         }
>         reset_control_deassert(bus->rst);
>
> -       ret = of_property_read_u32(pdev->dev.of_node,
> -                                  "bus-frequency", &bus->bus_frequency);
> -       if (ret < 0) {
> -               dev_err(&pdev->dev,
> -                       "Could not read bus-frequency property\n");
> -               bus->bus_frequency = I2C_MAX_STANDARD_MODE_FREQ;
> -       }
> +       bus->bus_frequency = I2C_MAX_STANDARD_MODE_FREQ;
> +       of_property_read_u32(pdev->dev.of_node,
> +                            "bus-frequency", &bus->bus_frequency);
>
>         match = of_match_node(aspeed_i2c_bus_of_table, pdev->dev.of_node);
>         if (!match)
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 21a2f139f445..4363bfe06f9b 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -1003,13 +1003,9 @@  static int aspeed_i2c_probe_bus(struct platform_device *pdev)
 	}
 	reset_control_deassert(bus->rst);
 
-	ret = of_property_read_u32(pdev->dev.of_node,
-				   "bus-frequency", &bus->bus_frequency);
-	if (ret < 0) {
-		dev_err(&pdev->dev,
-			"Could not read bus-frequency property\n");
-		bus->bus_frequency = I2C_MAX_STANDARD_MODE_FREQ;
-	}
+	bus->bus_frequency = I2C_MAX_STANDARD_MODE_FREQ;
+	of_property_read_u32(pdev->dev.of_node,
+			     "bus-frequency", &bus->bus_frequency);
 
 	match = of_match_node(aspeed_i2c_bus_of_table, pdev->dev.of_node);
 	if (!match)