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.

Available choices:
I. different meanings;
II. the same meaning;
II.