All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: <linux-i2c@vger.kernel.org>
Cc: Wolfram Sang <wsa@kernel.org>, Niyas Sait <niyas.sait@linaro.org>,
	Klaus Jensen <its@irrelevant.dk>,
	Andy Shevchenko <andy@kernel.org>, <linux-acpi@vger.kernel.org>,
	Jeremy Kerr <jk@codeconstruct.com.au>,
	Matt Johnston <matt@codeconstruct.com.au>,
	Shesha Bhushan Sreenivasamurthy <sheshas@marvell.com>,
	<linux-cxl@vger.kernel.org>, <linuxarm@huawei.com>,
	"Viacheslav A . Dubeyko" <viacheslav.dubeyko@bytedance.com>
Subject: [RFC PATCH v2 3/6] i2c: aspeed: Don't report error when optional dt bus-frequency not supplied
Date: Tue, 30 May 2023 15:55:58 +0100	[thread overview]
Message-ID: <20230530145601.2592-4-Jonathan.Cameron@huawei.com> (raw)
In-Reply-To: <20230530145601.2592-1-Jonathan.Cameron@huawei.com>

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(-)

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


  parent reply	other threads:[~2023-05-30 14:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 14:55 [RFC PATCH v2 0/6] i2c: Enabling use of aspeed-i2c with ACPI Jonathan Cameron
2023-05-30 14:55 ` [RFC PATCH v2 1/6] i2c: acpi: set slave mode flag Jonathan Cameron
2023-05-30 14:55 ` [RFC PATCH v2 2/6] i2c: aspeed: Use platform_get_irq() instead of opencoding Jonathan Cameron
2023-05-30 19:45   ` Andy Shevchenko
2023-05-31  9:36     ` Jonathan Cameron
2023-05-30 14:55 ` Jonathan Cameron [this message]
2023-05-30 19:47   ` [RFC PATCH v2 3/6] i2c: aspeed: Don't report error when optional dt bus-frequency not supplied Andy Shevchenko
2023-05-30 14:55 ` [RFC PATCH v2 4/6] i2c: aspeed: switch to generic fw properties Jonathan Cameron
2023-05-30 19:50   ` Andy Shevchenko
2023-05-31 10:46     ` Jonathan Cameron
2023-05-30 14:56 ` [RFC PATCH v2 5/6] i2c: aspeed: Set the fwnode for the adap->dev Jonathan Cameron
2023-05-30 19:51   ` Andy Shevchenko
2023-05-30 14:56 ` [RFC PATCH v2 6/6] HACK: i2c: aspeed: Comment clock out and make reset optional Jonathan Cameron
2023-05-30 19:59   ` Andy Shevchenko
2023-05-31  9:32     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230530145601.2592-4-Jonathan.Cameron@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=andy@kernel.org \
    --cc=its@irrelevant.dk \
    --cc=jk@codeconstruct.com.au \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=matt@codeconstruct.com.au \
    --cc=niyas.sait@linaro.org \
    --cc=sheshas@marvell.com \
    --cc=viacheslav.dubeyko@bytedance.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.