Commit 76b7062
i2c: amd8111: switch to devm_ functions
Use devm_kzalloc() to manage the memory allocation of the smbus structure
and devm_request_region() to manage the I/O port region.
This simplifies the error handling paths in the probe function by removing
manual cleanup and allows for the removal of the explicit cleanup in the
remove function.
Signed-off-by: Filippo Muscherà <filippo.muschera@gmail.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260202131304.8524-2-filippo.muschera@gmail.com1 parent f6dd64d commit 76b7062
1 file changed
Lines changed: 7 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 439 | + | |
| 440 | + | |
443 | 441 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 442 | + | |
| 443 | + | |
448 | 444 | | |
449 | 445 | | |
450 | 446 | | |
451 | | - | |
| 447 | + | |
452 | 448 | | |
453 | 449 | | |
454 | 450 | | |
| |||
459 | 455 | | |
460 | 456 | | |
461 | 457 | | |
462 | | - | |
| 458 | + | |
463 | 459 | | |
464 | 460 | | |
465 | 461 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | 462 | | |
473 | 463 | | |
474 | 464 | | |
475 | 465 | | |
476 | 466 | | |
477 | 467 | | |
478 | 468 | | |
479 | | - | |
480 | | - | |
481 | 469 | | |
482 | 470 | | |
483 | 471 | | |
| |||
0 commit comments