
868 S.W.2d 721 (1993)
William D. CARROLL, Jr., Appellant,
v.
Fred RANEY, Warden, Appellee.
Court of Criminal Appeals of Tennessee, at Jackson.
June 2, 1993.
William D. Carroll, Jr., pro se.
*722 Charles W. Burson, Atty. Gen. and Reporter, Amy L. Tarkington, Asst. Atty. Gen., Nashville, Elizabeth T. Rice, Dist. Atty. Gen., Somerville, for State of Tennessee.
No Petition to Appeal Applied for to the Supreme Court.

OPINION
WADE, Judge.
The petitioner, William D. Carroll, Jr., appeals the trial court's dismissal of his petition for writ of habeas corpus. The sole issue presented for review is whether the dismissal without an evidentiary hearing was appropriate.
We reverse the judgment and remand to the trial court for an evidentiary hearing to determine whether the petitioner's sentence had expired prior to the revocation of his 22-year commuted sentence.
The pleadings establish that in the early 1960's the petitioner, now over 70 years old, was convicted for rape and sentenced to death.[1] In 1964, former Governor Frank Clement commuted the sentence to life. Eight years later, on November 16, 1972, the sentence was commuted to 22 years by former Governor Winfield Dunn; the petitioner was released "under supervision" on that date. During the period of his release, the petitioner was charged with armed robbery. On June 28, 1973, he received a 40-year sentence. On March 19, 1974, Governor Dunn revoked the 1972 commutation and restored the life sentence on the prior crime. Neither the commutation nor its revocation appear in the record. Apparently, the Board of Paroles established that his second sentence began March 9, 1974, the parole eligibility date, the state contends, for the prior life sentence.[2]
The state concedes that the petitioner completed his 40-year sentence in 1990 as well as sentences of five, ten, and three years he had received in Shelby County in 1965. The state's position is that the petitioner currently serves a life sentence for the rape conviction with no expiration date; any parole is discretionary with the board. Documents filed by the state indicate that the petitioner was considered and denied on March 12, 1992, but will be reconsidered in 1994.
In State v. Warren, 740 S.W.2d 427 (Tenn. Crim. App. 1986), our court considered the permissible boundaries of habeas corpus:
[H]abeas corpus will not lie to challenge the denial of prison privileges and related internal matters, but is only available where a prisoner's sentence is void or his term of imprisonment has expired.
Id. at 428.
Any person restrained of his liberty may seek the writ of habeas corpus as a means of inquiring into the cause of his imprisonment or restraint. Tenn. Code Ann. § 29-21-101. Upon a judicial determination that the petitioner is illegally restrained, it is the duty of the court to grant the writ directing release. Tenn. Code Ann. § 29-21-104. Normally, the application should be made "to the court or judge most convenient in point of distance to the applicant, unless a sufficient reason be given in the petition for not applying to such court or judge." Tenn. Code Ann. § 29-21-105. Finally, the only relief that can be given a prisoner in a state habeas corpus proceeding is release from custody. Ussery v. Avery, 222 Tenn. 50, 432 S.W.2d 656 (1968); see Potts v. State, 833 S.W.2d 60, 62 (Tenn. 1992).
In this instance, the trial court considered pleadings, supportive documents, and affidavits filed by the state documenting petitioner's current status. There was no proof. The order of dismissal does not include any findings of fact.
The primary concern on the part of the petitioner is that the state has erroneously determined that his current sentence is one for life. He alleges that it was commuted to 22 years and that the governor's restoration *723 of the life sentence on March 19, 1974, came too late to have effect. The petitioner asserts that the 22-year sentence had expired on October 9 or 10, 1973, and that when the governor signed the revocation order some five months later, there was simply no sentence to revoke.[3]
There is no requirement that the trial court afford the habeas corpus petitioner an evidentiary hearing when the facts alleged in the petition, even if true, would not serve as a basis for relief. See State ex rel. Byrd v. Bomar, 214 Tenn. 476, 381 S.W.2d 280, 282 (1964); Russell v. Willis, 222 Tenn. 491, 437 S.W.2d 529, 531 (Tenn. 1969). Moreover, time credits, being internal matters, are generally inappropriate considerations in a habeas corpus proceeding. The validity of any sentence reduction credits must be addressed through the avenues of the Uniform Administrative Procedures Act. Tenn. Code Ann. §§ 4-5-101 to -324; State v. David N. Kuntz, No. 01C01-9101-CR-00019, 1991 WL 101857 (Tenn. Crim. App., Nashville, June 14, 1991).
In Rowell v. Dutton, 688 S.W.2d 474 (Tenn. Crim. App. 1985), however, our court held that the governor's authority to revoke an unconditional commutation of sentence exists only until the sentence has expired. See Tenn.Code.Ann. § 40-27-102. In that case, the proof submitted at the evidentiary hearing established that the sentence had, because of an accumulation of sentence credits, expired before the time of revocation:
[A] records clerk at the Tennessee State Penitentiary, and ... the senior records clerk at the Central Records Division of the Department of Correction ... [t]heir testimony revealed that the appellant had also received two hundred sixty (260) days of Program Participation Sentence Credits (PPSC) as of the date that his sentence was commuted in December 1979. After he returned to the penitentiary..., the appellant ... received ... credits . .. for thirteen months for a total of one hundred fifty-six (156) additional days of PPSC. These days .. . yielded a credit of four hundred sixteen (416) days which are subtracted from the January 3, 1985 expiration date ... and ... yielded an expiration date of November 15, 1983... .
* * * * * *
Thus, the net result of all these calculations is that at the time that Governor Alexander signed the revocation of clemency on November 22, 1983, the appellant's sentence had already expired. There was simply no sentence to revoke.
Id. at 476.
The governor has the power to grant pardons and commutations. Tenn. Const. art. III, § 6. There may be conditions. Tenn. Code Ann. § 40-27-102. By accepting executive clemency, the prisoner accepts any conditional aspects of the grant. State ex rel. Rowe v. Conners, 166 Tenn. 393, 61 S.W.2d 471 (1933). Revocation of a commutation because of the violation of its condition is not subject to judicial review. Id., 61 S.W.2d at 472. A commutation discharges a prisoner subject to any of its conditions. Upon a violation, the governor may revoke and reinstate the original term. White v. Livesay, 715 F. Supp. 202 (M.D.Tenn. 1989).
Otherwise, a commutation of sentence to a lesser term stands as if it had been a judgment pronounced in the first instance. Bowen v. State, 488 S.W.2d 373 (Tenn. 1972). It is a substitution of a lesser for a greater punishment. State ex rel. Murphy v. Wolfer, 127 Minn. 102, 148 N.W. 896 (1914). In consequence, the petitioner appears to have been subject to a 22-year sentence for a time at least  until the revocation by the governor. Unless there were specific conditions *724 attached to the original commutation, the petitioner may be entitled to release. See White v. State, 717 S.W.2d 309 (Tenn. Crim. App. 1986).
We cannot conclusively determine from this record whether the 22-year sentence had expired by the time Governor Dunn acted to revoke the commutation. Nothing suggests the commutation was conditional. We find no copy of the document in the record. While it may be that the petitioner had not fully served his sentence between 1961 and 1974 and while it is possible that specific conditions had been established in the executive order, we are compelled by the use of the applicable authorities to hold that the petitioner should have been afforded the opportunity to prove the length of the sentence, its date, the nature of the commutation, and any credit entitlements determined by the Department of Correction. The appointment of counsel may be appropriate.
In summary, the trial court should first determine whether the 1972 commutation was conditional. If not, there should be resolution of the petitioner's sentence status. Although the trial court should not consider the validity of disputed sentence credits, it may, according to the Rowell holding, decide whether those credits not in dispute caused the sentence to expire. If the evidence establishes that the sentence had, in fact, terminated prior to the commutation revocation, the petitioner is entitled to the grant of release. Otherwise, dismissal is proper.
Accordingly, the judgment is reversed and the cause is remanded for an evidentiary hearing on the issues.
BIRCH and WHITE, JJ., concur.
NOTES
[1]  The record indicates the petitioner was arrested September 9, 1961. Evidently the defendant was incarcerated from the time of his arrest until his conviction and sentence in May of 1962. Documents suggest jail credit may have been 551 days.
[2]  A letter in the court file indicates that the effective sentence date may have been January 10, 1974. On June 11, 1972, former Governor Lamar Alexander granted the petitioner clemency to the extent he was eligible for parole. After a 1984 conviction for assault and battery, this commutation was revoked.
[3]  The affidavit of Betty Stiddum, an Administrative Services Assistant in the Department of Correction, provides that when the petitioner's life sentence was further commuted to 22 years, his Good and Honor time computation "included One Hundred Nineteen Months (or Three Thousand Seventy Days)." This time period would equal approximately 9.9 years. Subtracting 9.9 years from a 22-year sentence would require service of 12.1 years. If the petitioner's effective date was September 9, 1961, and he was released on November 16, 1972, he had served approximately 11 years and 2 months on the 22-year sentence; he was eligible for parole after 11 years. Tenn. Code Ann. § 40-3612 (1975). This is evidence that the 22-year sentence had, in fact, expired in October of 1973, some six months prior to Governor Dunn's commutation.
