Take the 2-minute tour ×

I am trying to set up a devfreq driver for a peripheral on Linux. My init method for the driver looks as follows:

  static struct platform_driver zynq_csortfreq_driver = {
    .probe  = zynq_csortfreq_probe,
    .driver = {
        .name   = "ZYNQ_CSORT_DEVFREQ",
        .owner  = THIS_MODULE,

static int __init zynq_csortfreq_init(void)
    return platform_driver_register(&zynq_csortfreq_driver);

However, the probe function (zynq_csortfreq_probe) in my driver never seems to get called. I've read that in order for the probe call to work correctly, the .name value of the driver must match the name of the device - where can I find the name of the device?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

In order for the probe function to be called, you must add a device from a machine file or via the device tree. This is typically done with platform_device_register() or platform_add_devices() in machine files. Alternatively, of_platform_populate() is used for the device tree model, but code does not use this directly. The platform device documentation has information for your Linux kernel version. It seems that your Linux uses the device tree model. The documentation in the cpufree devicetree will have some helpful information on activating your driver for this board with device trees.

The dtsi file needs something like,

 soc {
     zyncfreq@addr {
          /* Other platform data */

Which will define the device for your machine. I would suggest that first you modify your machine files init_machine entry and use platform_device_register() to associate your driver with a device. Then you can later attempt to get the device tree mechanism working if you wish.

If you can view this closed question, my answer might be helpful if the Linux device-model documentation is not completely clear. However, I think for your case the Linux docs are sufficient.

share|improve this answer

Your Answer


