My question involves criminal law for the state of: California, San Diego county

Hi, I am 19 and I was minding my own business outside my friends house in my car when a police officer comes up to me and says he smelled marijuana. I Had none so when he asked to search my car I said go ahead and when he opened the trunk he found 2 beer bottles up opened an opened bottle on Kahlua. he also found a very small amount of Sailor Jerrys in a Soda bottle in the right back of the car under the passenger seat.

I got charged with 25662A BP, 23226A

I was wondering if I could get off the MIP by saying the car is my mother's, I know that probably wont work for the 23226A (open container within reach). The thing is i wasn't pulled over or anything I had just left my mom's friends house to get something and was in there for a minute when the cop rolled up and the car is registered under my mom and she's well in her 50's so i was thinking that could get the MIP thrown out.

Any advice would be helpful or how I could go about getting a deferred sentence, charges dropped, and etc. Also i was hoping I wouldn't lose my license by stating I'm a delivery boy so a license is imperative to my livelihood.

Thanks.