One of the interesting elements about the Harry Potter series' conception of divination and prophecy is that nothing is set in stone. Prophecies are ambiguous as to certain details, which is why a great deal of wizards do not take them seriously. For example, the famous prophecy which states that neither the Dark Lord nor the Chosen One can "live while the other survives" is A) not clear as to which of the two is going to live in the first place and B) not clear as to who the identity of the Chosen One is. Before it is clear that it is Harry, Neville Longbottom is a possible candidate for being the Chosen One, after all.
Does this inhibit the free will of the characters? Not necessarily, no more than Macbeth's free will is inhibited in the eponymous Shakespeare tragedy. JK Rowling herself has compared the main prophecy in Harry Potter to the witches' prophecy in Macbeth: both prophecies are in their way self-fulfilling since if neither Macbeth nor Voldemort had acted upon them with the intent of stopping them, there is a chance they might not have come to pass. Of course, there is the question of Macbeth already being ambitious and Harry already being someone with a passion for doing the right thing, so even if a prophecy had not existed, they might have still acted as they did, but the audience can never be sure. Here are JK Rowling's words on the matter from a 2005 interview:
I think there's a line there between the moment in Chamber of Secrets when Dumbledore says so famously, "It's our choices that define us, not our abilities," straight through to Dumbledore sitting in his office, saying to Harry, “The prophecy is significant only because you and Voldemort choose to make it so.” If you both chose to walk away, you could both live! That's the bottom line. If both of them decided, “We're not playing,” and walked away… but, it’s not going to happen, because as far as Voldemort’s concerned, Harry’s a threat. They must meet each other.
So it is the characters who choose to fulfill the prophecy themselves, not destiny or some other force.
Additionally, the series constantly affirms the free will of the characters over fate. For example, in The Prisoner of Azkaban, Dumbledore says this about prophecy:
The consequences of our actions are always so complicated, so diverse, that predicting the future is a very difficult business indeed.
Dumbledore constantly validates free will in this manner, assuring Harry that choices define people more than anything else. Even when Harry realizes the similarities between his background and Voldemort's, Dumbledore tells him the thing that kept Harry from becoming Voldemort was his choices, not fate.