Commit 27fcf3d
spi: sifive: Simplify clock handling with devm_clk_get_enabled()
[ Upstream commit 140039c ]
Replace devm_clk_get() followed by clk_prepare_enable() with
devm_clk_get_enabled() for the bus clock. This reduces boilerplate code
and error handling, as the managed API automatically disables the clock
when the device is removed or if probe fails.
Remove the now-unnecessary clk_disable_unprepare() calls from the probe
error path and the remove callback. Adjust the error handling to use the
existing put_host label.
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://patch.msgid.link/73d0d8ecb4e1af5a558d6a7866c0f886d94fe3d1.1773885292.git.xiaopei01@kylinos.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 0f25236 ("spi: sifive: fix controller deregistration")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent fac9cfa commit 27fcf3d
1 file changed
Lines changed: 6 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| |||
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | 346 | | |
353 | 347 | | |
354 | 348 | | |
| |||
357 | 351 | | |
358 | 352 | | |
359 | 353 | | |
360 | | - | |
| 354 | + | |
361 | 355 | | |
362 | 356 | | |
363 | 357 | | |
364 | 358 | | |
365 | 359 | | |
366 | 360 | | |
367 | | - | |
| 361 | + | |
368 | 362 | | |
369 | 363 | | |
370 | 364 | | |
| |||
393 | 387 | | |
394 | 388 | | |
395 | 389 | | |
396 | | - | |
| 390 | + | |
397 | 391 | | |
398 | 392 | | |
399 | 393 | | |
| |||
402 | 396 | | |
403 | 397 | | |
404 | 398 | | |
405 | | - | |
| 399 | + | |
406 | 400 | | |
407 | 401 | | |
408 | 402 | | |
409 | 403 | | |
410 | | - | |
411 | | - | |
412 | 404 | | |
413 | 405 | | |
414 | 406 | | |
| |||
422 | 414 | | |
423 | 415 | | |
424 | 416 | | |
425 | | - | |
426 | 417 | | |
427 | 418 | | |
428 | 419 | | |
| |||
0 commit comments