Skip to content

Commit

Permalink
m68k: allow NULL clock for clk_get_rate
Browse files Browse the repository at this point in the history
Make the behaviour of clk_get_rate consistent with common clk's
clk_get_rate by accepting NULL clocks as parameter. Some device
drivers rely on this, and will cause an OOPS otherwise.

Fixes: facdf0e ("m68knommu: introduce basic clk infrastructure")
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org
Reported-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
  • Loading branch information
Jonas Gorski authored and Greg Ungerer committed Aug 28, 2017
1 parent cc4a41f commit 94b2822
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/m68k/coldfire/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ EXPORT_SYMBOL(clk_put);

unsigned long clk_get_rate(struct clk *clk)
{
if (!clk)
return 0;

return clk->rate;
}
EXPORT_SYMBOL(clk_get_rate);
Expand Down

0 comments on commit 94b2822

Please sign in to comment.