Is credit used to mean the same thing in the next two sentences (see options)?

He arrived five minutes late, but to his credit he did work an extra ten minutes at the end of his shift.

Give her credit for trying.

OPTIONS: (a). different meanings (b). the same meaning
(b).