it's not a good practice to transmit "global" services (like the database driver, the cache system etc...) through the parameters of the function. Instead you should use the dependency injection to retrieve these services and one way to do that is to add the database driver as a dependences of the class which need it.
To do that you can edit the config/profilefields.yml file, find the service corresponding to your class, add the database_driver (dbal.conn) in the dependences and then handle it in your constructor. (look at \phpbb\profilefields\manager for an example)