Skip to content

Commit f5ca6d4

Browse files
lyakhpmundt
authored andcommitted
sh: simplify WARN usage in SH clock driver
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 03c5ecd commit f5ca6d4

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎drivers/sh/clk.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,9 @@ void propagate_rate(struct clk *tclk)
160160

161161
static void __clk_disable(struct clk *clk)
162162
{
163-
if (clk->usecount == 0) {
164-
printk(KERN_ERR "Trying disable clock %s with 0 usecount\n",
165-
clk->name);
166-
WARN_ON(1);
163+
if (WARN(!clk->usecount, "Trying to disable clock %s with 0 usecount\n",
164+
clk->name))
167165
return;
168-
}
169166

170167
if (!(--clk->usecount)) {
171168
if (likely(clk->ops && clk->ops->disable))

0 commit comments

Comments
 (0)