Linux设备模型之platform(5)

                                                 ret = -EBUSY;
                                                 goto failed;
                               }
                      }
                      pr_debug("Registering platform device '%s'. Parent at %s/n",
                      dev_name(&pdev->dev), dev_name(pdev->dev.parent));
                      ret = device_add(&pdev->dev);                                //标准设备注册
                      if (ret == 0)
                               return ret;
    failed:
               while (--i >= 0) {
                       struct resource *r = &pdev->resource[i];
                       unsigned long type = resource_type(r);
                       if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
                                release_resource(r);
               }
                return ret;
   }
 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/22707.html