linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhong <floridsleeves@gmail.com>
To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: jirislaby@kernel.org, bcm-kernel-feedback-list@broadcom.com,
	alcooperx@gmail.com, Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v1] drivers/tty/serial/8250: check the return value of clk_set_rate()
Date: Mon, 19 Sep 2022 01:15:23 -0700	[thread overview]
Message-ID: <20220919081523.1579904-1-floridsleeves@gmail.com> (raw)

Check the return of clk_set_rate() which could fail if there is error
setting the rate.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 drivers/tty/serial/8250/8250_bcm7271.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
index 8efdc271eb75..9014853d6e35 100644
--- a/drivers/tty/serial/8250/8250_bcm7271.c
+++ b/drivers/tty/serial/8250/8250_bcm7271.c
@@ -671,7 +671,9 @@ static void init_real_clk_rates(struct device *dev, struct brcmuart_priv *priv)
 			priv->real_rates[x] = clk_get_rate(priv->baud_mux_clk);
 		}
 	}
-	clk_set_rate(priv->baud_mux_clk, priv->default_mux_rate);
+	rc = clk_set_rate(priv->baud_mux_clk, priv->default_mux_rate);
+	if (rc)
+		dev_err(dev, "Error restoring default BAUD MUX clock\n");
 }
 
 static void set_clock_mux(struct uart_port *up, struct brcmuart_priv *priv,
-- 
2.25.1


             reply	other threads:[~2022-09-19  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  8:15 Li Zhong [this message]
2022-09-19  8:41 ` [PATCH v1] drivers/tty/serial/8250: check the return value of clk_set_rate() Greg KH

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=20220919081523.1579904-1-floridsleeves@gmail.com \
    --to=floridsleeves@gmail.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).