Attorney: appointed counsel: replacement of counsel: we granted the Attorney General’s petition for review. The Attorney General contends that in replacing defendant’s appointed counsel with another court-appointed attorney, the trial court did not violate defendant’s right to counsel under either the federal or the state Constitution. Conceding that the replacement violated state statutory law and was an abuse of discretion by the trial court, the Attorney General argues that the error requires reversal only upon a showing of prejudice, which defendant did not establish. We agree with the Attorney General on both points; an element of the Sixth Amendment right to counsel “is the right of a defendant who does not require appointed counsel to choose who will represent him.” (548 U.S. at p. 144.) The Sixth Amendment, the court noted, “ ‘guarantees the defendant the right to be represented by an otherwise qualified attorney whom that defendant can afford to hire, or who is willing to represent the defendant even though he is without funds.’ ” (Ibid., quoting Caplin & Drysdale, Chartered v. United States (1989) 491 U.S. 617, 624-625.) This Sixth Amendment guarantee is subject to an important limitation, however: “The right to counsel of choice does not extend to defendants who require counsel to be appointed for them.” (United States v. Gonzalez-Lopez, supra, 548 U.S. at p. 151, italics added.); under the federal Constitution the right to effective assistance of counsel is grounded in the Sixth Amendment’s right to counsel, not in the Fifth Amendment’s right to due process of law. (See United States v. Gonzalez-Lopez, supra, 548 U.S. at p. 147); our “state Constitution does not give an indigent defendant the right to select a court-appointed attorney,” but a trial court may abuse its discretion in refusing to appoint an attorney “with whom the defendant has a long-standing relationship.” (People v. Jones (2004) 33 Cal.4th 234, 244.) “Removal of an indigent defendant’s appointed counsel . . . poses a greater potential threat to the defendant’s constitutional right to counsel” than refusing “to appoint an attorney requested by the defendant . . . .” (Ibid.); the statutory source of the trial court’s authority to disqualify an attorney derives from its power “[t]o control in furtherance of justice, the conduct of its ministerial officers, and of all other persons in any manner connected with a judicial proceeding before it, in every matter pertaining thereto.” (Code Civ. Proc., § 128, subd. (a)(5).) This power, which is “ ‘inherent in every court’ ” (In re Charlisse C. (2008) 45 Cal.4th 145, 159), authorizes a trial court in either a civil or a criminal case to discharge an attorney who has a conflict of interest. (See People ex rel. Dept. of Corporations v. SpeeDee Oil Change Systems, Inc. (1999) 20 Cal.4th 1135, 1145; People v. Jones, supra, 33 Cal.4th at p. 244, fn. 2.) A trial court’s disqualification of an attorney is generally reviewed for abuse of discretion. (Charlisse C., supra, at p. 159; Haraguchi v. Superior Court (2008) 43 Cal.4th 706, 711-713.); as defendant in this case has not shown a reasonable probability that the trial court’s erroneous replacement of the public defender altered the outcome of the trial (People v. Watson, supra, 46 Cal.2d at p. 836), he is not entitled to reversal of his conviction; (we agree that a promptly filed writ petition normally provides the only effective remedy for an erroneous replacement of appointed counsel because of a potential conflict of interest. But we perceive a practical difficulty. The replaced attorney no longer represents the defendant and therefore cannot, without defendant’s authorization, seek writ relief on the defendant’s behalf; ideally, the attorney about to be removed should request that the trial court stay removal long enough to permit that attorney to prepare a writ petition. When such a stay has not been granted and reinstatement of the prior appointed attorney would best serve the defendant’s interests, however, replacement counsel has a professional obligation to pursue writ relief.) (Cal. S. Ct., 05.04.10, P. v. Noriega, S160953).