Though only one person (he) is mentioned, the context suggests that a plural is in view and thus it was Hannah, Elkanah, and Samuel who worshipped the Lord. The Hebrew text contains a variant word from which suggests that it was originally a plural and not a singular.1
28 Therefore I have lent him to the LORD. As long as he lives, he is lent to the LORD.” And he worshiped the LORD there.