Legit medical pot growers insist they’re willing to work with the San Francisco Police Department, even as those same growers are raided and hauled into court.

Indeed, after prosecutors dropped charges Thursday against a Golden Gate Heights man — who was arrested in June after an SFPD raid netted 162 immature marijuana plants, and five valid medical marijuana recommendations — the man’s attorney said that all of the time and taxpayer money wasted on his unsuccessful prosecution could have been avoided if SFPD had made a single phone call, either prior or during the raid.

Cody Phillips, 28, was arrested June 15 at his Crestmont Drive home after officers from the SFPD’s narcotics conducted a raid following a days-long stakeout. Officers seized the plants, about $9,000 in cash, and Phillips’s (expensive) growing equipment.

Paperwork also seized by SFPD showed that Phillips was growing for Axis of Love, a nonprofit that provides cheap or free medical marijuana to low income patients, according to Derek St. Pierre, Phillips’s attorney.

Had the narcotics officers called Axis of Love to verify Phillips’s status as a legal grower growing for sick people, or had officers heeded the medical marijuana recommendations — county law permits up to 25 mature plants per recommendation, meaning Phillips *was* technically out of compliance by the letter of the law, if not the spirit — prosecutors and police could have saved court time and taxpayer money, St. Pierre said.

“If police would have simply followed up with a phone call before they tore the garden down… they would have saved a lot of headaches for everybody,” said St. Pierre, who will return to court on September 1 to begin proceedings to recover the cash, pot and growing equipment seized by SFPD.

According to the police report, the arresting officers discovered the necessary medical marijuana recommendations “as soon as we entered the house.” Just the same, officers deemed that “Phillips could not possibly be a care provider for twenty patients, and [determined[ that Phillips was cultivating marijuana for the purposes of sales,” according to the report.

SFPD has been criticized by pot advocates for not adhering to the city’s “lowest-priority ordinance,” which is supposed to make marijuana crime police’s lowest priority (duh). In its defense, SFPD feels medical marijuana laws are hazy and wants better-defined laws, recently-reassigned Commander John Loftus told the Police Commission last month.

A spokesperson for San Francisco District Attorney Kamala Harris did not respond to a request for comment, but St. Pierre said that prosecutors had told him they would drop charges because Phillips had provided enough information to prove he was a legit grower — all information that was handy to the arresting officers, he reiterated.