[U-Boot] pre_probe under struct driver

Keerthy j-keerthy at ti.com
Tue Jun 4 13:01:50 UTC 2019


Hi Simon/Tom,

I am looking at the device_probe function in drivers/core/device.c

ret = uclass_pre_probe_device(dev);
         if (ret)
                 goto fail;

         if (dev->parent && dev->parent->driver->child_pre_probe) {
                 ret = dev->parent->driver->child_pre_probe(dev);
                 if (ret)
                         goto fail;
         }

         if (drv->ofdata_to_platdata && dev_has_of_node(dev)) {
                 ret = drv->ofdata_to_platdata(dev);
                 if (ret)
                         goto fail;
         }

         /* Process 'assigned-{clocks/clock-parents/clock-rates}' 
properties */
         ret = clk_set_defaults(dev);

In case of a device like MPU we would like setup voltage before setting 
the clocks and i was looking if we can have a pre_probe for a driver
to do things before driver gets probed. Neither uclass_pre_probe_device 
nor dev->parent->driver->child_pre_probe benefit me in this case.

Does my situation warrant adding a new hook to struct driver? Or are 
there instances of such handling already in u-boot.

Thanks in Advance,
Keerthy


More information about the U-Boot mailing list