Repository navigation
Commit f5ed9c3
drivers/staging/iio/adc/spear_adc.c: use clk_prepare_enable and clk_disable_unprepare
Clk_prepare_enable and clk_disable_unprepare combine clk_prepare and
clk_enable, and clk_disable and clk_unprepare. They make the code more
concise, and ensure that clk_unprepare is called when clk_enable fails.
A simplified version of the semantic patch that introduces calls to these
functions is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e;
@@
- clk_prepare(e);
- clk_enable(e);
+ clk_prepare_enable(e);
@@
expression e;
@@
- clk_disable(e);
- clk_unprepare(e);
+ clk_disable_unprepare(e);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>1 parent 91b4171 commit f5ed9c3
1 file changed
Lines changed: 8 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 333 | + | |
340 | 334 | | |
341 | 335 | | |
342 | | - | |
| 336 | + | |
343 | 337 | | |
344 | 338 | | |
345 | 339 | | |
346 | 340 | | |
347 | 341 | | |
348 | 342 | | |
349 | | - | |
| 343 | + | |
350 | 344 | | |
351 | 345 | | |
352 | 346 | | |
353 | 347 | | |
354 | 348 | | |
355 | | - | |
| 349 | + | |
356 | 350 | | |
357 | 351 | | |
358 | 352 | | |
359 | 353 | | |
360 | 354 | | |
361 | 355 | | |
362 | | - | |
| 356 | + | |
363 | 357 | | |
364 | 358 | | |
365 | 359 | | |
| |||
389 | 383 | | |
390 | 384 | | |
391 | 385 | | |
392 | | - | |
| 386 | + | |
393 | 387 | | |
394 | 388 | | |
395 | 389 | | |
396 | 390 | | |
397 | 391 | | |
398 | | - | |
399 | | - | |
400 | 392 | | |
401 | | - | |
| 393 | + | |
402 | 394 | | |
403 | 395 | | |
404 | 396 | | |
| |||
416 | 408 | | |
417 | 409 | | |
418 | 410 | | |
419 | | - | |
420 | | - | |
| 411 | + | |
421 | 412 | | |
422 | 413 | | |
423 | 414 | | |
| |||
0 commit comments