---
name: "clk_round_rate"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/clk_round_rate"
---

# clk\_round\_rate(9)

adjust a rate to the exact rate a clock can provide

## NAME

clk\_round\_rate - adjust a rate to the exact rate a clock can provide

## SYNOPSIS

**long clk\_round\_rate(struct clk \*** *clk***, unsigned long** *rate***);**

## ARGUMENTS

*clk*

clock source

*rate*

desired clock rate in Hz

## DESCRIPTION

This answers the question “if I were to pass *rate* to **clk\_set\_rate**, what clock rate would I end up with?” without changing the hardware in any way. In other words:

rate = clk\_round\_rate(clk, r);

and:

clk\_set\_rate(clk, r); rate = clk\_get\_rate(clk);

are equivalent except the former does not modify the clock hardware in any way.

Returns rounded clock rate in Hz, or negative errno.

## COPYRIGHT
