Commit 7a57354
can: mcp251x: add error handling for power enable in open and resume
Add missing error handling for mcp251x_power_enable() calls in both
mcp251x_open() and mcp251x_can_resume() functions.
In mcp251x_open(), if power enable fails, jump to error path to close
candev without attempting to disable power again.
In mcp251x_can_resume(), properly check return values of power enable calls
for both power and transceiver regulators. If any fails, return the error
code to the PM framework and log the failure.
This ensures the driver properly handles power control failures and
maintains correct device state.
Signed-off-by: Wenyuan Li <[email protected]>
Link: https://patch.msgid.link/[email protected]
[mkl: fix patch description]
[mkl: mcp251x_can_resume(): replace goto by return]
Signed-off-by: Marc Kleine-Budde <[email protected]>1 parent cadf601 commit 7a57354
1 file changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1229 | 1233 | | |
1230 | 1234 | | |
1231 | 1235 | | |
| |||
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
| 1279 | + | |
1275 | 1280 | | |
1276 | 1281 | | |
1277 | 1282 | | |
| |||
1516 | 1521 | | |
1517 | 1522 | | |
1518 | 1523 | | |
| 1524 | + | |
1519 | 1525 | | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1524 | 1543 | | |
1525 | 1544 | | |
1526 | 1545 | | |
| |||
0 commit comments