A remark on Pinney's equation